@abaplint/core 2.120.17 → 2.120.18
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.
|
@@ -332,7 +332,7 @@ class TypeUtils {
|
|
|
332
332
|
return this.isAssignable(source, target);
|
|
333
333
|
}
|
|
334
334
|
isAssignableStrict(source, target, node) {
|
|
335
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
335
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
336
336
|
const calculated = node ? this.isCalculated(node) : false;
|
|
337
337
|
/*
|
|
338
338
|
console.dir(source);
|
|
@@ -343,6 +343,17 @@ class TypeUtils {
|
|
|
343
343
|
&& (target instanceof basic_1.XStringType || target instanceof basic_1.XSequenceType)) {
|
|
344
344
|
return false;
|
|
345
345
|
}
|
|
346
|
+
if (target instanceof basic_1.NumericType
|
|
347
|
+
&& (source instanceof basic_1.CharacterType || source instanceof basic_1.StringType)
|
|
348
|
+
&& ((_a = source.getAbstractTypeData()) === null || _a === void 0 ? void 0 : _a.derivedFromConstant) === true) {
|
|
349
|
+
const constant = node === null || node === void 0 ? void 0 : node.concatTokens();
|
|
350
|
+
if (constant !== undefined
|
|
351
|
+
&& ((constant.startsWith("'") && constant.endsWith("'"))
|
|
352
|
+
|| (constant.startsWith("`") && constant.endsWith("`")))
|
|
353
|
+
&& /^\d*$/.test(constant.substring(1, constant.length - 1)) === false) {
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
346
357
|
if (calculated) {
|
|
347
358
|
return this.isAssignable(source, target);
|
|
348
359
|
}
|
|
@@ -359,25 +370,25 @@ class TypeUtils {
|
|
|
359
370
|
}
|
|
360
371
|
if (source instanceof basic_1.CharacterType) {
|
|
361
372
|
if (target instanceof basic_1.CharacterType) {
|
|
362
|
-
if (((
|
|
373
|
+
if (((_b = source.getAbstractTypeData()) === null || _b === void 0 ? void 0 : _b.derivedFromConstant) === true) {
|
|
363
374
|
return source.getLength() <= target.getLength();
|
|
364
375
|
}
|
|
365
376
|
return source.getLength() === target.getLength();
|
|
366
377
|
}
|
|
367
378
|
else if (target instanceof basic_1.IntegerType) {
|
|
368
|
-
if (((
|
|
379
|
+
if (((_c = source.getAbstractTypeData()) === null || _c === void 0 ? void 0 : _c.derivedFromConstant) === true) {
|
|
369
380
|
return true;
|
|
370
381
|
}
|
|
371
382
|
return false;
|
|
372
383
|
}
|
|
373
384
|
else if (target instanceof basic_1.XStringType) {
|
|
374
|
-
if (((
|
|
385
|
+
if (((_d = source.getAbstractTypeData()) === null || _d === void 0 ? void 0 : _d.derivedFromConstant) === true) {
|
|
375
386
|
return (node === null || node === void 0 ? void 0 : node.concatTokens()) !== "''";
|
|
376
387
|
}
|
|
377
388
|
return false;
|
|
378
389
|
}
|
|
379
390
|
else if (target instanceof basic_1.StringType) {
|
|
380
|
-
if (((
|
|
391
|
+
if (((_e = source.getAbstractTypeData()) === null || _e === void 0 ? void 0 : _e.derivedFromConstant) === true) {
|
|
381
392
|
return true;
|
|
382
393
|
}
|
|
383
394
|
return false;
|
|
@@ -385,7 +396,7 @@ class TypeUtils {
|
|
|
385
396
|
}
|
|
386
397
|
else if (source instanceof basic_1.HexType) {
|
|
387
398
|
if (target instanceof basic_1.HexType) {
|
|
388
|
-
if (((
|
|
399
|
+
if (((_f = source.getAbstractTypeData()) === null || _f === void 0 ? void 0 : _f.derivedFromConstant) === true) {
|
|
389
400
|
return source.getLength() <= target.getLength();
|
|
390
401
|
}
|
|
391
402
|
return source.getLength() === target.getLength();
|
|
@@ -394,7 +405,7 @@ class TypeUtils {
|
|
|
394
405
|
return false;
|
|
395
406
|
}
|
|
396
407
|
else if (target instanceof basic_1.IntegerType || target instanceof basic_1.Integer8Type) {
|
|
397
|
-
if (((
|
|
408
|
+
if (((_g = source.getAbstractTypeData()) === null || _g === void 0 ? void 0 : _g.derivedFromConstant) === true) {
|
|
398
409
|
return true;
|
|
399
410
|
}
|
|
400
411
|
return false;
|
|
@@ -405,13 +416,13 @@ class TypeUtils {
|
|
|
405
416
|
return false;
|
|
406
417
|
}
|
|
407
418
|
else if (target instanceof basic_1.CharacterType) {
|
|
408
|
-
if (((
|
|
419
|
+
if (((_h = source.getAbstractTypeData()) === null || _h === void 0 ? void 0 : _h.derivedFromConstant) === true) {
|
|
409
420
|
return true;
|
|
410
421
|
}
|
|
411
422
|
return false;
|
|
412
423
|
}
|
|
413
424
|
else if (target instanceof basic_1.IntegerType) {
|
|
414
|
-
if (((
|
|
425
|
+
if (((_j = source.getAbstractTypeData()) === null || _j === void 0 ? void 0 : _j.derivedFromConstant) === true) {
|
|
415
426
|
return true;
|
|
416
427
|
}
|
|
417
428
|
return false;
|
|
@@ -421,7 +432,7 @@ class TypeUtils {
|
|
|
421
432
|
return false;
|
|
422
433
|
}
|
|
423
434
|
else if (target instanceof basic_1.XSequenceType || target instanceof basic_1.XStringType) {
|
|
424
|
-
if (((
|
|
435
|
+
if (((_k = source.getAbstractTypeData()) === null || _k === void 0 ? void 0 : _k.derivedFromConstant) === true) {
|
|
425
436
|
return true;
|
|
426
437
|
}
|
|
427
438
|
return false;
|
|
@@ -465,7 +476,7 @@ class TypeUtils {
|
|
|
465
476
|
return false;
|
|
466
477
|
}
|
|
467
478
|
else if (target instanceof basic_1.Integer8Type || target instanceof basic_1.PackedType) {
|
|
468
|
-
if (((
|
|
479
|
+
if (((_l = source.getAbstractTypeData()) === null || _l === void 0 ? void 0 : _l.derivedFromConstant) === true) {
|
|
469
480
|
return true;
|
|
470
481
|
}
|
|
471
482
|
return false;
|
package/build/src/registry.js
CHANGED