forked from brucehuke/ts-testcase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
case40.ts
40 lines (29 loc) · 789 Bytes
/
case40.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export default {}
class StrObj {
a: string = 'a1'
b: string = 'b2'
}
class Test {
private _a:StrObj = new StrObj()
constructor() {}
get a(): StrObj {
return this._a
}
log() {
// [ERROR] console - Aborted(Assertion failed: isStruct(), at: /home/runner/work/binaryen.js/binaryen.js/binaryen/src/wasm/wasm-type.cpp,1330,getStruct).
console.log('~~~~~~~~~~~~a', this.a.a)
// work
console.log('~~~~~~~~~~~~_a', this._a.a)
}
}
class T2 extends Test {
log2() {
// [ERROR] console - Aborted(Assertion failed: isStruct(), at: /home/runner/work/binaryen.js/binaryen.js/binaryen/src/wasm/wasm-type.cpp,1330,getStruct).
console.log('~~~~~~~~~~~~log2', this.a.b)
}
}
let t: Test = new Test()
t.log()
let t2: T2 = new T2()
t2.log()
t2.log2()