@abaplint/core 2.105.22 → 2.105.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -278,7 +278,8 @@ class TypeUtils {
278
278
  }
279
279
  return false;
280
280
  }
281
- else if (target instanceof cgeneric_type_1.CGenericType) {
281
+ else if (target instanceof cgeneric_type_1.CGenericType
282
+ || target instanceof basic_1.GenericObjectReferenceType) {
282
283
  return false;
283
284
  }
284
285
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
@@ -7,19 +7,22 @@ const let_1 = require("./let");
7
7
  class ConvBody {
8
8
  runSyntax(node, scope, filename) {
9
9
  if (node === undefined) {
10
- return;
10
+ throw new Error("ConvBody, node undefined");
11
11
  }
12
12
  let scoped = false;
13
13
  const l = node.findDirectExpression(Expressions.Let);
14
14
  if (l) {
15
15
  scoped = new let_1.Let().runSyntax(l, scope, filename);
16
16
  }
17
- for (const s of node.findDirectExpressions(Expressions.Source)) {
18
- new source_1.Source().runSyntax(s, scope, filename);
17
+ const s = node.findDirectExpression(Expressions.Source);
18
+ if (s === undefined) {
19
+ throw new Error("ConvBody, no source found");
19
20
  }
21
+ const sourceType = new source_1.Source().runSyntax(s, scope, filename);
20
22
  if (scoped === true) {
21
23
  scope.pop(node.getLastToken().getEnd());
22
24
  }
25
+ return sourceType;
23
26
  }
24
27
  }
25
28
  exports.ConvBody = ConvBody;
@@ -24,6 +24,7 @@ const _builtin_1 = require("../_builtin");
24
24
  const attribute_chain_1 = require("./attribute_chain");
25
25
  const dereference_1 = require("./dereference");
26
26
  const _typed_identifier_1 = require("../../types/_typed_identifier");
27
+ const _type_utils_1 = require("../_type_utils");
27
28
  /*
28
29
  * Type interference, valid scenarios:
29
30
  * typed = VALUE #( ... ). right hand side must follow left hand type
@@ -107,7 +108,10 @@ class Source {
107
108
  case "CONV":
108
109
  {
109
110
  const foundType = this.determineType(node, scope, filename, targetType);
110
- new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
111
+ const bodyType = new conv_body_1.ConvBody().runSyntax(node.findDirectExpression(Expressions.ConvBody), scope, filename);
112
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(foundType, bodyType) === false) {
113
+ throw new Error("CONV: Types not compatible");
114
+ }
111
115
  this.addIfInferred(node, scope, filename, foundType);
112
116
  return foundType;
113
117
  }
@@ -7,6 +7,7 @@ const target_1 = require("../expressions/target");
7
7
  const basic_1 = require("../../types/basic");
8
8
  const fstarget_1 = require("../expressions/fstarget");
9
9
  const inline_data_1 = require("../expressions/inline_data");
10
+ const _type_utils_1 = require("../_type_utils");
10
11
  // todo: issue error for short APPEND if the source is without header line
11
12
  class Append {
12
13
  runSyntax(node, scope, filename) {
@@ -49,7 +50,17 @@ class Append {
49
50
  else if (targetType instanceof basic_1.VoidType) {
50
51
  rowType = targetType;
51
52
  }
52
- new source_1.Source().runSyntax(source, scope, filename, rowType);
53
+ const sourceType = new source_1.Source().runSyntax(source, scope, filename, rowType);
54
+ if (node.findDirectTokenByText("LINES")) {
55
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, targetType) === false) {
56
+ throw new Error("Incompatible types");
57
+ }
58
+ }
59
+ else {
60
+ if (new _type_utils_1.TypeUtils(scope).isAssignable(sourceType, rowType) === false) {
61
+ throw new Error("Incompatible types");
62
+ }
63
+ }
53
64
  }
54
65
  const from = node.findExpressionAfterToken("FROM");
55
66
  if (from && from.get() instanceof Expressions.Source) {
@@ -68,7 +68,7 @@ class ReadTable {
68
68
  }
69
69
  else if (t) {
70
70
  const targetType = new target_1.Target().runSyntax(t, scope, filename);
71
- if (new _type_utils_1.TypeUtils(scope).isAssignable(rowType, targetType) === false) {
71
+ if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(rowType, targetType) === false) {
72
72
  throw new Error("Incompatible types");
73
73
  }
74
74
  }
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.105.22";
68
+ return "2.105.24";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.105.22",
3
+ "version": "2.105.24",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "homepage": "https://abaplint.org",
52
52
  "devDependencies": {
53
- "@microsoft/api-extractor": "^7.41.0",
53
+ "@microsoft/api-extractor": "^7.41.1",
54
54
  "@types/chai": "^4.3.12",
55
55
  "@types/mocha": "^10.0.6",
56
- "@types/node": "^20.11.20",
56
+ "@types/node": "^20.11.22",
57
57
  "chai": "^4.4.1",
58
58
  "eslint": "^8.57.0",
59
59
  "mocha": "^10.3.0",