@abaplint/core 2.97.10 → 2.97.11
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.
|
@@ -199,16 +199,24 @@ class TypeUtils {
|
|
|
199
199
|
return false;
|
|
200
200
|
}
|
|
201
201
|
isAssignableStrict(source, target) {
|
|
202
|
-
var _a;
|
|
202
|
+
var _a, _b;
|
|
203
203
|
/*
|
|
204
204
|
console.dir(source);
|
|
205
205
|
console.dir(target);
|
|
206
206
|
*/
|
|
207
|
-
if (source instanceof basic_1.CharacterType
|
|
208
|
-
if (
|
|
209
|
-
|
|
207
|
+
if (source instanceof basic_1.CharacterType) {
|
|
208
|
+
if (target instanceof basic_1.CharacterType) {
|
|
209
|
+
if (((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
210
|
+
return source.getLength() <= target.getLength();
|
|
211
|
+
}
|
|
212
|
+
return source.getLength() === target.getLength();
|
|
213
|
+
}
|
|
214
|
+
else if (target instanceof basic_1.IntegerType) {
|
|
215
|
+
if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
return false;
|
|
210
219
|
}
|
|
211
|
-
return source.getLength() === target.getLength();
|
|
212
220
|
}
|
|
213
221
|
else if (source instanceof basic_1.StringType && target instanceof basic_1.StructureType) {
|
|
214
222
|
if (this.structureContainsString(target)) {
|
|
@@ -216,6 +224,19 @@ class TypeUtils {
|
|
|
216
224
|
}
|
|
217
225
|
return true;
|
|
218
226
|
}
|
|
227
|
+
else if (source instanceof basic_1.StructureType && target instanceof basic_1.StructureType) {
|
|
228
|
+
const sourceComponents = source.getComponents();
|
|
229
|
+
const targetComponents = target.getComponents();
|
|
230
|
+
if (sourceComponents.length !== targetComponents.length) {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
for (let i = 0; i < sourceComponents.length; i++) {
|
|
234
|
+
if (this.isAssignableStrict(sourceComponents[i].type, targetComponents[i].type) === false) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
219
240
|
return this.isAssignable(source, target);
|
|
220
241
|
}
|
|
221
242
|
isAssignable(source, target) {
|
package/build/src/registry.js
CHANGED