forked from brucehuke/ts-testcase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global_init.ts
42 lines (32 loc) · 1.03 KB
/
global_init.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
40
41
42
class Test {
private static _getbool(): boolean {
return false
}
bool(): boolean {
// console.log('~~~~~~~~~~~~Test._getbool()', Test._getbool())
return Test._getbool()
}
val(): boolean {
return true
}
}
let t = new Test()
// ERR] load wasm module failed. error: WASM module load failed: type mismatch: expect heap object but got others
if (t.bool()) {
console.log('~~~~~~~~_getbool return true')
} else {
console.log('~~~~~~~~_getbool return false')
}
// ERR] load wasm module failed. error: WASM module load failed: type mismatch or constant expression required
let res: boolean = t.val()
if (res) {
console.log('~~~~~~~~_getbool res return true')
} else {
console.log('~~~~~~~~_getbool res return false')
}
function getBool(): boolean {
return true
}
let b: boolean = getBool()
// ERR] load wasm module failed. error: WASM module load failed: type mismatch or constant expression required
console.log('~~~~~~~~~~~~b', b)