@abaplint/core 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.
|
@@ -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,27 @@ class Source {
|
|
|
124
128
|
{
|
|
125
129
|
let foundType = this.determineType(node, input, targetType);
|
|
126
130
|
const s = Source.runSyntax(node.findDirectExpression(Expressions.Source), input);
|
|
127
|
-
|
|
131
|
+
/*
|
|
132
|
+
console.dir(node.concatTokens());
|
|
133
|
+
console.dir(targetType);
|
|
134
|
+
console.dir(foundType);
|
|
135
|
+
console.dir(s);
|
|
136
|
+
*/
|
|
137
|
+
if (foundType && foundType.isGeneric() && s) {
|
|
128
138
|
foundType = new basic_1.DataReference(s);
|
|
129
139
|
}
|
|
130
|
-
else if (foundType) {
|
|
140
|
+
else if (foundType === undefined && s) {
|
|
141
|
+
foundType = new basic_1.DataReference(s);
|
|
142
|
+
}
|
|
143
|
+
else if (foundType && targetType === undefined) {
|
|
131
144
|
foundType = new basic_1.DataReference(foundType);
|
|
132
145
|
}
|
|
146
|
+
/*
|
|
147
|
+
if (targetType && !(targetType instanceof DataReference)) {
|
|
148
|
+
const message = `REF: Types not compatible, ` + targetType.constructor.name;
|
|
149
|
+
input.issues.push(syntaxIssue(input, node.getFirstToken(), message));
|
|
150
|
+
}
|
|
151
|
+
*/
|
|
133
152
|
this.addIfInferred(node, input, foundType);
|
|
134
153
|
return foundType;
|
|
135
154
|
}
|
|
@@ -281,11 +300,20 @@ class Source {
|
|
|
281
300
|
const typeExpression = node.findDirectExpression(Expressions.TypeNameOrInfer);
|
|
282
301
|
const typeToken = typeExpression === null || typeExpression === void 0 ? void 0 : typeExpression.getFirstToken();
|
|
283
302
|
const typeName = typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr();
|
|
303
|
+
/*
|
|
304
|
+
console.dir(inferredType);
|
|
305
|
+
console.dir(typeToken);
|
|
306
|
+
*/
|
|
307
|
+
// hmm, need to align all this
|
|
284
308
|
if (typeName === "#" && inferredType && typeToken) {
|
|
285
309
|
const found = basic.lookupQualifiedName(inferredType.getQualifiedName());
|
|
286
310
|
if (found) {
|
|
287
311
|
input.scope.addReference(typeToken, found, _reference_1.ReferenceType.InferredType, input.filename);
|
|
288
312
|
}
|
|
313
|
+
else if (inferredType instanceof basic_1.DataReference) {
|
|
314
|
+
const tid = new _typed_identifier_1.TypedIdentifier(typeToken, input.filename, inferredType);
|
|
315
|
+
input.scope.addReference(typeToken, tid, _reference_1.ReferenceType.InferredType, input.filename);
|
|
316
|
+
}
|
|
289
317
|
else if (inferredType instanceof basic_1.ObjectReferenceType) {
|
|
290
318
|
const def = input.scope.findObjectDefinition(inferredType.getQualifiedName());
|
|
291
319
|
if (def) {
|
package/build/src/registry.js
CHANGED