@abaplint/core 2.101.18 → 2.101.20

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.
@@ -1105,7 +1105,7 @@ BuiltIn.methods = [
1105
1105
  },
1106
1106
  optional: {
1107
1107
  "case": new basic_1.CharacterType(1),
1108
- "sep": basic_1.IntegerType.get(),
1108
+ "sep": new basic_1.CLikeType(),
1109
1109
  "min": basic_1.IntegerType.get(),
1110
1110
  },
1111
1111
  return: basic_1.StringType.get(),
@@ -209,13 +209,13 @@ class TypeUtils {
209
209
  }
210
210
  return false;
211
211
  }
212
- isAssignableStrict(source, target, containsMethodCall = false) {
213
- var _a, _b, _c, _d, _e, _f;
212
+ isAssignableStrict(source, target, calculated = false) {
213
+ var _a, _b, _c, _d, _e, _f, _g;
214
214
  /*
215
215
  console.dir(source);
216
216
  console.dir(target);
217
217
  */
218
- if (containsMethodCall) {
218
+ if (calculated) {
219
219
  return this.isAssignable(source, target);
220
220
  }
221
221
  if (source instanceof basic_1.CharacterType) {
@@ -257,10 +257,13 @@ class TypeUtils {
257
257
  return false;
258
258
  }
259
259
  else if (target instanceof basic_1.IntegerType) {
260
+ if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
261
+ return true;
262
+ }
260
263
  return false;
261
264
  }
262
265
  else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
263
- if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
266
+ if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
264
267
  return true;
265
268
  }
266
269
  return false;
@@ -52,10 +52,12 @@ class MethodCallParam {
52
52
  if (child.get() instanceof Expressions.Source) {
53
53
  sourceType = new source_1.Source().runSyntax(child, scope, filename, targetType);
54
54
  }
55
+ const calculated = child.findFirstExpression(Expressions.MethodCallChain) !== undefined
56
+ || child.findFirstExpression(Expressions.ArithOperator) !== undefined;
55
57
  if (sourceType === undefined) {
56
58
  throw new Error("No source type determined, method source");
57
59
  }
58
- else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType, child.findFirstExpression(Expressions.MethodCallChain) !== undefined) === false) {
60
+ else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType, calculated) === false) {
59
61
  throw new Error("Method parameter type not compatible");
60
62
  }
61
63
  }
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.101.18";
68
+ return "2.101.20";
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.101.18",
3
+ "version": "2.101.20",
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.35.2",
53
+ "@microsoft/api-extractor": "^7.35.3",
54
54
  "@types/chai": "^4.3.5",
55
55
  "@types/mocha": "^10.0.1",
56
- "@types/node": "^20.3.0",
56
+ "@types/node": "^20.3.1",
57
57
  "chai": "^4.3.7",
58
58
  "eslint": "^8.42.0",
59
59
  "mocha": "^10.2.0",