We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f4495b commit d21091dCopy full SHA for d21091d
test/unit/array.spec.ts
@@ -38,4 +38,17 @@ export class ArrayTests {
38
const result = util.executeLua(lua);
39
Expect(result).toBe(5);
40
}
41
+
42
+ @Test("Derived array access")
43
+ public derivedArrayAccess(): void {
44
+ const lua = `local arr = {firstElement=function(self) return self[1]; end};`
45
+ + util.transpileString(
46
+ `interface CustomArray extends Array<number>{ firstElement():number; };
47
+ declare const arr: CustomArray;
48
+ arr[0] = 3;
49
+ return arr.firstElement();`
50
+ );
51
+ const result = util.executeLua(lua);
52
+ Expect(result).toBe(3);
53
+ }
54
0 commit comments