@abaplint/core 2.102.32 → 2.102.34

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.
@@ -1345,6 +1345,7 @@ export declare class CurrentScope {
1345
1345
  getType(): ScopeType;
1346
1346
  push(stype: ScopeType, sname: string, start: Position, filename: string): void;
1347
1347
  isOO(): boolean;
1348
+ isGlobalOO(): boolean;
1348
1349
  isTypePool(): boolean;
1349
1350
  setAllowHeaderUse(name: string): void;
1350
1351
  isAllowHeaderUse(name: string): boolean;
@@ -387,6 +387,9 @@ class CurrentScope {
387
387
  }
388
388
  return false;
389
389
  }
390
+ isGlobalOO() {
391
+ return this.parentObj.getType() === "INTF" || this.parentObj.getType() === "CLAS";
392
+ }
390
393
  isTypePool() {
391
394
  var _a;
392
395
  return ((_a = this.current) === null || _a === void 0 ? void 0 : _a.getIdentifier().filename.endsWith(".type.abap")) === true || false;
@@ -16,7 +16,8 @@ class InsertInternal {
16
16
  if (t) {
17
17
  targetType = new target_1.Target().runSyntax(t, scope, filename);
18
18
  }
19
- if (targetType instanceof basic_1.TableType && node.findDirectTokenByText("LINES") === undefined) {
19
+ if (targetType instanceof basic_1.TableType
20
+ && node.findDirectTokenByText("LINES") === undefined) {
20
21
  targetType = targetType.getRowType();
21
22
  }
22
23
  let source = node.findDirectExpression(Expressions.SimpleSource4);
@@ -34,7 +35,8 @@ class InsertInternal {
34
35
  new fstarget_1.FSTarget().runSyntax(afterAssigning, scope, filename, sourceType);
35
36
  }
36
37
  }
37
- if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
38
+ if (node.findDirectTokenByText("INITIAL") === undefined
39
+ && new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, targetType) === false) {
38
40
  throw new Error("Types not compatible");
39
41
  }
40
42
  const afterInto = node.findExpressionAfterToken("INTO");
@@ -18,6 +18,13 @@ class Type {
18
18
  && (found === null || found === void 0 ? void 0 : found.getType().containsVoid()) === false) {
19
19
  throw new Error("TYPES definition cannot be generic, " + found.getName());
20
20
  }
21
+ if (scope.isGlobalOO() && found.getType() instanceof basic_1.PackedType) {
22
+ const concat = node.concatTokens().toUpperCase();
23
+ if ((concat.includes(" TYPE P ") || concat.includes(" TYPE P."))
24
+ && concat.includes(" DECIMALS ") === false) {
25
+ throw new Error("Specify DECIMALS in OO context for packed");
26
+ }
27
+ }
21
28
  return found;
22
29
  }
23
30
  const fallback = node.findFirstExpression(Expressions.NamespaceSimpleName);
@@ -65,7 +65,7 @@ class Registry {
65
65
  }
66
66
  static abaplintVersion() {
67
67
  // magic, see build script "version.sh"
68
- return "2.102.32";
68
+ return "2.102.34";
69
69
  }
70
70
  getDDICReferences() {
71
71
  return this.ddicReferences;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.102.32",
3
+ "version": "2.102.34",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",