@abaplint/core 2.102.2 → 2.102.3
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.
|
@@ -12,6 +12,7 @@ const _typed_identifier_1 = require("../types/_typed_identifier");
|
|
|
12
12
|
const basic_1 = require("../types/basic");
|
|
13
13
|
const ddic_1 = require("../../ddic");
|
|
14
14
|
const _object_oriented_1 = require("./_object_oriented");
|
|
15
|
+
const _reference_1 = require("./_reference");
|
|
15
16
|
class Procedural {
|
|
16
17
|
constructor(reg, scope) {
|
|
17
18
|
this.scope = scope;
|
|
@@ -85,7 +86,19 @@ class Procedural {
|
|
|
85
86
|
if (param.type === undefined || param.type === "") {
|
|
86
87
|
found = new basic_1.AnyType();
|
|
87
88
|
}
|
|
88
|
-
else {
|
|
89
|
+
else if (param.type.includes("=>")) {
|
|
90
|
+
// then its a type from global INTF or CLAS
|
|
91
|
+
const [clas, name] = param.type.split("=>");
|
|
92
|
+
const def = this.scope.findObjectDefinition(clas);
|
|
93
|
+
if (def) {
|
|
94
|
+
const type = def.getTypeDefinitions().getByName(name);
|
|
95
|
+
if (type) {
|
|
96
|
+
this.scope.addReference(nameToken, type, _reference_1.ReferenceType.TypeReference, filename);
|
|
97
|
+
found = type.getType();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (found === undefined) {
|
|
89
102
|
found = ddic.lookup(param.type).type;
|
|
90
103
|
}
|
|
91
104
|
if (param.direction === types_1.FunctionModuleParameterDirection.tables) {
|
|
@@ -126,10 +126,12 @@ class MethodParameters {
|
|
|
126
126
|
}
|
|
127
127
|
for (const item of items) {
|
|
128
128
|
const parameter = allImporting.find(p => p.getName().toUpperCase() === item.name);
|
|
129
|
+
const calculated = item.source.findFirstExpression(Expressions.MethodCallChain) !== undefined
|
|
130
|
+
|| item.source.findFirstExpression(Expressions.ArithOperator) !== undefined;
|
|
129
131
|
if (parameter === undefined) {
|
|
130
132
|
throw new Error("Method importing parameter \"" + item.name + "\" does not exist");
|
|
131
133
|
}
|
|
132
|
-
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(item.sourceType, parameter.getType()) === false) {
|
|
134
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(item.sourceType, parameter.getType(), calculated) === false) {
|
|
133
135
|
throw new Error("Method parameter type not compatible, " + item.name);
|
|
134
136
|
}
|
|
135
137
|
this.requiredParameters.delete(item.name);
|
package/build/src/registry.js
CHANGED
|
@@ -42,6 +42,8 @@ class PreferPragmas extends _abap_rule_1.ABAPRule {
|
|
|
42
42
|
shortDescription: `prefer pragmas over pseudo comments `,
|
|
43
43
|
extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-pragmas-to-pseudo-comments`,
|
|
44
44
|
tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],
|
|
45
|
+
badExample: `DATA foo1 TYPE i. "#EC NEEDED`,
|
|
46
|
+
goodExample: `DATA foo2 TYPE i ##NEEDED.`,
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
getConfig() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.102.
|
|
3
|
+
"version": "2.102.3",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.1.6"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"fast-xml-parser": "^4.2.
|
|
66
|
+
"fast-xml-parser": "^4.2.6",
|
|
67
67
|
"json5": "^2.2.3",
|
|
68
68
|
"vscode-languageserver-types": "^3.17.3"
|
|
69
69
|
}
|