@abaplint/runtime 2.1.90 → 2.1.92

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.
@@ -39,13 +39,27 @@ async function cast(target, source) {
39
39
  }
40
40
  }
41
41
  else if (checkIntf === true && (targetClass === null || targetClass === void 0 ? void 0 : targetClass.INTERNAL_TYPE) === "INTF") {
42
- const list = [...source.get().IMPLEMENTED_INTERFACES];
42
+ const list = [...source.get().constructor.IMPLEMENTED_INTERFACES];
43
+ // interfaces implemented in super classes
43
44
  let sup = source.get().super;
44
45
  while (sup !== undefined) {
45
- list.push(...sup.get().IMPLEMENTED_INTERFACES);
46
+ list.push(...sup.get().constructor.IMPLEMENTED_INTERFACES);
46
47
  sup = sup.get().super;
47
48
  }
48
- // todo: ammend list with interfaces implemented by interfaces
49
+ // interfaces implemented by interfaces
50
+ const visit = new Set(list);
51
+ while (visit.size > 0) {
52
+ const intfName = visit.values().next().value;
53
+ // @ts-ignore
54
+ const intf = abap.Classes[intfName];
55
+ for (const i of (intf === null || intf === void 0 ? void 0 : intf.IMPLEMENTED_INTERFACES) || []) {
56
+ if (visit.has(i) === false) {
57
+ visit.add(i);
58
+ list.push(i);
59
+ }
60
+ }
61
+ visit.delete(intfName);
62
+ }
49
63
  const isImplemented = list.some(i => i === targetName);
50
64
  if (isImplemented === false) {
51
65
  throwError();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.1.90",
3
+ "version": "2.1.92",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",