@abaplint/core 2.113.157 → 2.113.158

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.
@@ -95,6 +95,10 @@ class Source {
95
95
  {
96
96
  const foundType = this.determineType(node, input, targetType);
97
97
  const bodyType = cond_body_1.CondBody.runSyntax(node.findDirectExpression(Expressions.CondBody), input, foundType);
98
+ /*
99
+ console.log("COND BODY type;:");
100
+ console.dir(bodyType);
101
+ */
98
102
  if (foundType === undefined || foundType.isGeneric()) {
99
103
  this.addIfInferred(node, input, bodyType);
100
104
  }
@@ -124,12 +128,24 @@ class Source {
124
128
  {
125
129
  let foundType = this.determineType(node, input, targetType);
126
130
  const s = Source.runSyntax(node.findDirectExpression(Expressions.Source), input);
131
+ /*
132
+ console.dir(node.concatTokens());
133
+ console.dir(targetType);
134
+ console.dir(foundType);
135
+ console.dir(s);
136
+ */
127
137
  if (foundType === undefined && s) {
128
138
  foundType = new basic_1.DataReference(s);
129
139
  }
130
- else if (foundType) {
140
+ else if (foundType && targetType === undefined) {
131
141
  foundType = new basic_1.DataReference(foundType);
132
142
  }
143
+ /*
144
+ if (targetType && !(targetType instanceof DataReference)) {
145
+ const message = `REF: Types not compatible, ` + targetType.constructor.name;
146
+ input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
147
+ }
148
+ */
133
149
  this.addIfInferred(node, input, foundType);
134
150
  return foundType;
135
151
  }
@@ -281,11 +297,20 @@ class Source {
281
297
  const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
282
298
  const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
283
299
  const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
300
+ /*
301
+ console.dir(inferredType);
302
+ console.dir(typeToken);
303
+ */
304
+ // hmm, need to align all this
284
305
  if (typeName === "#" && inferredType && typeToken) {
285
306
  const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
286
307
  if (found) {
287
308
  input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
288
309
  }
310
+ else if (inferredType instanceof basic_1.DataReference) {
311
+ const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
312
+ input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
313
+ }
289
314
  else if (inferredType instanceof basic_1.ObjectReferenceType) {
290
315
  const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
291
316
  if (def) {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.157";
70
+ return "2.113.158";
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.157",
3
+ "version": "2.113.158",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",