@abaplint/core 2.113.141 → 2.113.142

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.
@@ -16,8 +16,9 @@ const dereference_1 = require("./dereference");
16
16
  const source_field_symbol_1 = require("./source_field_symbol");
17
17
  const source_field_1 = require("./source_field");
18
18
  const _syntax_input_1 = require("../_syntax_input");
19
+ const version_1 = require("../../../version");
19
20
  class FieldChain {
20
- static runSyntax(node, input, refType) {
21
+ static runSyntax(node, input, refType, allowGenericDeference = false) {
21
22
  var _a, _b, _c;
22
23
  if (((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SourceField
23
24
  && node.findDirectExpression(Expressions.ComponentName)) {
@@ -92,6 +93,12 @@ class FieldChain {
92
93
  }
93
94
  else if (current.get() instanceof expressions_1.Dereference) {
94
95
  context = dereference_1.Dereference.runSyntax(current, context, input);
96
+ if (allowGenericDeference === false
97
+ && (context === null || context === void 0 ? void 0 : context.isGeneric()) === true
98
+ && input.scope.getVersion() < version_1.Version.v756
99
+ && input.scope.getVersion() !== version_1.Version.Cloud) {
100
+ throw new Error("A generic reference cannot be dereferenced");
101
+ }
95
102
  }
96
103
  else if (current.get() instanceof Expressions.ComponentName) {
97
104
  if (context instanceof basic_1.TableType && context.isWithHeader()) {
@@ -36,8 +36,9 @@ const assert_error_1 = require("../assert_error");
36
36
  * VALUE #( ... ). syntax error
37
37
  * DATA(bar) = VALUE #( ... ). give error, no type can be derived
38
38
  */
39
+ // TODO: refactor all these method parameters to objects, this is getting messy
39
40
  class Source {
40
- static runSyntax(node, input, targetType, writeReference = false) {
41
+ static runSyntax(node, input, targetType, writeReference = false, allowGenericDeference = false) {
41
42
  if (node === undefined) {
42
43
  return undefined;
43
44
  }
@@ -200,7 +201,7 @@ class Source {
200
201
  }
201
202
  }
202
203
  else if (get instanceof Expressions.FieldChain) {
203
- context = field_chain_1.FieldChain.runSyntax(first, input, type);
204
+ context = field_chain_1.FieldChain.runSyntax(first, input, type, allowGenericDeference);
204
205
  }
205
206
  else if (get instanceof Expressions.StringTemplate) {
206
207
  context = string_template_1.StringTemplate.runSyntax(first, input);
@@ -29,7 +29,7 @@ class Assign {
29
29
  sourceType = basic_1.VoidType.get("Dynamic");
30
30
  }
31
31
  else {
32
- sourceType = source_1.Source.runSyntax(theSource, input);
32
+ sourceType = source_1.Source.runSyntax(theSource, input, undefined, false, true);
33
33
  }
34
34
  if ((assignSource === null || assignSource === void 0 ? void 0 : assignSource.getChildren().length) === 5
35
35
  && ((_a = assignSource === null || assignSource === void 0 ? void 0 : assignSource.getFirstChild()) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase()) === "COMPONENT") {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.141";
70
+ return "2.113.142";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.141",
3
+ "version": "2.113.142",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",