mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 22:41:27 +00:00
Support parameter properties; Minor formatting
This commit is contained in:
9
tests/parser/constructor.ts
Normal file
9
tests/parser/constructor.ts
Normal file
@ -0,0 +1,9 @@
|
||||
class MyClass {
|
||||
constructor() {}
|
||||
constructor(a: i32) {}
|
||||
constructor(a: i32, b: i32) {}
|
||||
}
|
||||
|
||||
class MyClassImplicit {
|
||||
constructor(public a: i32, private readonly b: i32 = 2, c: i32 = 3) {}
|
||||
}
|
8
tests/parser/constructor.ts.fixture.ts
Normal file
8
tests/parser/constructor.ts.fixture.ts
Normal file
@ -0,0 +1,8 @@
|
||||
class MyClass {
|
||||
constructor() {}
|
||||
constructor(a: i32) {}
|
||||
constructor(a: i32, b: i32) {}
|
||||
}
|
||||
class MyClassImplicit {
|
||||
constructor(public a: i32, private readonly b: i32 = 2, c: i32 = 3) {}
|
||||
}
|
Reference in New Issue
Block a user