forked from cerc-io/assemblyscript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructor-errors.ts
More file actions
52 lines (43 loc) · 878 Bytes
/
constructor-errors.ts
File metadata and controls
52 lines (43 loc) · 878 Bytes
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
43
44
45
46
47
48
49
50
51
52
class CtorAccessThis {
a: i32 = 0;
constructor(
public b: i32 = this.a, // TS2333
public c: i32 = this.foo() // TS2333
) {}
foo(): i32 { return 0; }
}
new CtorAccessThis();
class CtorAccessThisInline {
d: i32 = 0;
@inline
constructor(
public e: i32 = this.d, // TS2333
public f: i32 = this.bar() // TS2333
) {}
bar(): i32 { return 0; }
}
new CtorAccessThisInline();
class CtorSuper {
g: i32 = 0;
baz(): i32 { return 0; }
}
class CtorAccessSuper extends CtorSuper {
constructor(
public h: i32 = super.g, // TS2336
public i: i32 = super.baz() // TS2336
) {
super();
}
}
new CtorAccessSuper();
class CtorAccessSuperInline extends CtorSuper {
@inline
constructor(
public j: i32 = super.g, // TS2336
public k: i32 = super.baz() // TS2336
) {
super();
}
}
new CtorAccessSuperInline();
ERROR("EOF");