@abaplint/core 2.113.217 → 2.113.218

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.
@@ -448,7 +448,7 @@ class TypeUtils {
448
448
  if (!(sourceRowType instanceof basic_1.StructureType)) {
449
449
  return false;
450
450
  }
451
- else if (!(this.structureContainsString(sourceRowType))
451
+ else if (!this.structureContainsString(sourceRowType)
452
452
  && this.structureContainsVoid(sourceRowType) === false) {
453
453
  return false;
454
454
  }
@@ -458,7 +458,7 @@ class TypeUtils {
458
458
  if (!(targetRowType instanceof basic_1.StructureType)) {
459
459
  return false;
460
460
  }
461
- else if (!(this.structureContainsString(targetRowType))
461
+ else if (!this.structureContainsString(targetRowType)
462
462
  && this.structureContainsVoid(targetRowType) === false) {
463
463
  return false;
464
464
  }
@@ -11,7 +11,7 @@ class CorrespondingBody {
11
11
  }
12
12
  const base = (_a = node.findDirectExpression(Expressions.CorrespondingBodyBase)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Source);
13
13
  if (base) {
14
- source_1.Source.runSyntax(base, input);
14
+ source_1.Source.runSyntax(base, input, targetType);
15
15
  }
16
16
  let type = undefined;
17
17
  for (const s of node.findDirectExpressions(Expressions.Source)) {
@@ -67,7 +67,7 @@ class Registry {
67
67
  }
68
68
  static abaplintVersion() {
69
69
  // magic, see build script "version.sh"
70
- return "2.113.217";
70
+ return "2.113.218";
71
71
  }
72
72
  getDDICReferences() {
73
73
  return this.ddicReferences;
@@ -939,7 +939,6 @@ ${indentation}${uniqueName} = ${source.concatTokens()}.\n${indentation}`);
939
939
  const source = high.findExpressionAfterToken("MESSAGE");
940
940
  if ((source === null || source === void 0 ? void 0 : source.get()) instanceof Expressions.MessageSourceSource
941
941
  && ((_a = source.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Source) {
942
- ;
943
942
  const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);
944
943
  const indentation = " ".repeat(high.getFirstToken().getStart().getCol() - 1);
945
944
  const firstToken = high.getFirstToken();
@@ -45,7 +45,7 @@ class FullyTypeConstants extends _abap_rule_1.ABAPRule {
45
45
  for (const stat of file.getStatements()) {
46
46
  if ((stat.get() instanceof Statements.Constant
47
47
  || (this.conf.checkData === true && stat.get() instanceof Statements.Data))
48
- && (!this.isTyped(stat))) {
48
+ && !this.isTyped(stat)) {
49
49
  const type = stat.get() instanceof Statements.Constant ? "constant definition" : "data definition";
50
50
  let token = (_a = stat.findFirstExpression(expressions_1.NamespaceSimpleName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
51
51
  if (token === undefined) {
@@ -60,7 +60,7 @@ class FullyTypeConstants extends _abap_rule_1.ABAPRule {
60
60
  return issues;
61
61
  }
62
62
  isTyped(stat) {
63
- return (stat.findFirstExpression(expressions_1.Type) || stat.findFirstExpression(expressions_1.TypeTable));
63
+ return stat.findFirstExpression(expressions_1.Type) || stat.findFirstExpression(expressions_1.TypeTable);
64
64
  }
65
65
  }
66
66
  exports.FullyTypeConstants = FullyTypeConstants;
@@ -180,7 +180,7 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
180
180
  return [idef];
181
181
  }
182
182
  for (const m of this.findInterfaceMethods(idef)) {
183
- if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {
183
+ if (this.isAbstract(m, interfaceInfo, def)) {
184
184
  continue;
185
185
  }
186
186
  if (this.isImplemented(m, def, impl) === false) {
@@ -199,6 +199,23 @@ class ImplementMethods extends _abap_rule_1.ABAPRule {
199
199
  }
200
200
  return ret;
201
201
  }
202
+ isAbstract(m, interfaceInfo, def) {
203
+ if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {
204
+ return true;
205
+ }
206
+ if (!def.superClassName) {
207
+ return false;
208
+ }
209
+ // look up in superclass if method is abstract there
210
+ const superClass = this.findClass(def.superClassName);
211
+ const superInterface = superClass === null || superClass === void 0 ? void 0 : superClass.def.interfaces.find(iface => iface.name.toUpperCase() === m.objectName.toUpperCase());
212
+ if (superClass && superInterface) {
213
+ return this.isAbstract(m, superInterface, superClass.def);
214
+ }
215
+ else {
216
+ return false;
217
+ }
218
+ }
202
219
  isImplemented(m, def, impl) {
203
220
  if (impl === undefined) {
204
221
  return false;
@@ -61,9 +61,9 @@ ENDFORM.`,
61
61
  for (let i = 0; i < statements.length; i++) {
62
62
  const node = statements[i];
63
63
  const nodeType = node.get();
64
- if ((nodeType instanceof Statements.MethodImplementation
64
+ if (nodeType instanceof Statements.MethodImplementation
65
65
  || nodeType instanceof Statements.Form
66
- || nodeType instanceof Statements.FunctionModule)) {
66
+ || nodeType instanceof Statements.FunctionModule) {
67
67
  statementCounter = 0;
68
68
  continue;
69
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/core",
3
- "version": "2.113.217",
3
+ "version": "2.113.218",
4
4
  "description": "abaplint - Core API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/abaplint.d.ts",