@abaplint/cli 2.113.157 → 2.113.159

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.
Files changed (2) hide show
  1. package/build/cli.js +31 -3
  2. package/package.json +2 -2
package/build/cli.js CHANGED
@@ -28115,6 +28115,10 @@ class Source {
28115
28115
  {
28116
28116
  const foundType = this.determineType(node, input, targetType);
28117
28117
  const bodyType = cond_body_1.CondBody.runSyntax(node.findDirectExpression(Expressions.CondBody), input, foundType);
28118
+ /*
28119
+ console.log("COND BODY type;:");
28120
+ console.dir(bodyType);
28121
+ */
28118
28122
  if (foundType === undefined || foundType.isGeneric()) {
28119
28123
  this.addIfInferred(node, input, bodyType);
28120
28124
  }
@@ -28144,12 +28148,27 @@ class Source {
28144
28148
  {
28145
28149
  let foundType = this.determineType(node, input, targetType);
28146
28150
  const s = Source.runSyntax(node.findDirectExpression(Expressions.Source), input);
28147
- if (foundType === undefined && s) {
28151
+ /*
28152
+ console.dir(node.concatTokens());
28153
+ console.dir(targetType);
28154
+ console.dir(foundType);
28155
+ console.dir(s);
28156
+ */
28157
+ if (foundType && foundType.isGeneric() && s) {
28158
+ foundType = new basic_1.DataReference(s);
28159
+ }
28160
+ else if (foundType === undefined && s) {
28148
28161
  foundType = new basic_1.DataReference(s);
28149
28162
  }
28150
- else if (foundType) {
28163
+ else if (foundType && targetType === undefined) {
28151
28164
  foundType = new basic_1.DataReference(foundType);
28152
28165
  }
28166
+ /*
28167
+ if (targetType && !(targetType instanceof DataReference)) {
28168
+ const message = `REF: Types not compatible, ` + targetType.constructor.name;
28169
+ input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
28170
+ }
28171
+ */
28153
28172
  this.addIfInferred(node, input, foundType);
28154
28173
  return foundType;
28155
28174
  }
@@ -28301,11 +28320,20 @@ class Source {
28301
28320
  const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
28302
28321
  const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
28303
28322
  const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
28323
+ /*
28324
+ console.dir(inferredType);
28325
+ console.dir(typeToken);
28326
+ */
28327
+ // hmm, need to align all this
28304
28328
  if (typeName === "#" && inferredType && typeToken) {
28305
28329
  const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
28306
28330
  if (found) {
28307
28331
  input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
28308
28332
  }
28333
+ else if (inferredType instanceof basic_1.DataReference) {
28334
+ const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
28335
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
28336
+ }
28309
28337
  else if (inferredType instanceof basic_1.ObjectReferenceType) {
28310
28338
  const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
28311
28339
  if (def) {
@@ -54766,7 +54794,7 @@ class Registry {
54766
54794
  }
54767
54795
  static abaplintVersion() {
54768
54796
  // magic, see build script "version.sh"
54769
- return "2.113.157";
54797
+ return "2.113.159";
54770
54798
  }
54771
54799
  getDDICReferences() {
54772
54800
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.113.157",
3
+ "version": "2.113.159",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "homepage": "https://abaplint.org",
40
40
  "devDependencies": {
41
- "@abaplint/core": "^2.113.156",
41
+ "@abaplint/core": "^2.113.159",
42
42
  "@types/chai": "^4.3.20",
43
43
  "@types/minimist": "^1.2.5",
44
44
  "@types/mocha": "^10.0.10",