@abaplint/core 2.102.30 → 2.102.31
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.
|
@@ -4,6 +4,7 @@ exports.TypeUtils = void 0;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const basic_1 = require("../types/basic");
|
|
6
6
|
const cgeneric_type_1 = require("../types/basic/cgeneric_type");
|
|
7
|
+
// todo: refactor to static? for performance
|
|
7
8
|
class TypeUtils {
|
|
8
9
|
constructor(scope) {
|
|
9
10
|
this.scope = scope;
|
|
@@ -298,6 +299,11 @@ class TypeUtils {
|
|
|
298
299
|
return false;
|
|
299
300
|
}
|
|
300
301
|
}
|
|
302
|
+
else if (source instanceof basic_1.IntegerType) {
|
|
303
|
+
if (target instanceof basic_1.StringType || target instanceof basic_1.Integer8Type) {
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
301
307
|
else if (source instanceof basic_1.FloatType) {
|
|
302
308
|
if (target instanceof basic_1.IntegerType) {
|
|
303
309
|
return false;
|
|
@@ -8,6 +8,7 @@ const target_1 = require("../expressions/target");
|
|
|
8
8
|
const fstarget_1 = require("../expressions/fstarget");
|
|
9
9
|
const basic_1 = require("../../types/basic");
|
|
10
10
|
const inline_data_1 = require("../expressions/inline_data");
|
|
11
|
+
const _type_utils_1 = require("../_type_utils");
|
|
11
12
|
class InsertInternal {
|
|
12
13
|
runSyntax(node, scope, filename) {
|
|
13
14
|
let targetType;
|
|
@@ -15,7 +16,7 @@ class InsertInternal {
|
|
|
15
16
|
if (t) {
|
|
16
17
|
targetType = new target_1.Target().runSyntax(t, scope, filename);
|
|
17
18
|
}
|
|
18
|
-
if (targetType instanceof basic_1.TableType) {
|
|
19
|
+
if (targetType instanceof basic_1.TableType && node.findDirectTokenByText("LINES") === undefined) {
|
|
19
20
|
targetType = targetType.getRowType();
|
|
20
21
|
}
|
|
21
22
|
let source = node.findDirectExpression(Expressions.SimpleSource4);
|
|
@@ -33,6 +34,9 @@ class InsertInternal {
|
|
|
33
34
|
new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
37
|
+
if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
|
|
38
|
+
throw new Error("Types not compatible");
|
|
39
|
+
}
|
|
36
40
|
const afterInto = node.findExpressionAfterToken("INTO");
|
|
37
41
|
if ((afterInto === null || afterInto === void 0 ? void 0 : afterInto.get()) instanceof Expressions.Target && sourceType) {
|
|
38
42
|
const inline = afterInto.findDirectExpression(Expressions.InlineData);
|
package/build/src/registry.js
CHANGED