mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 11:11:43 +00:00
Field initializers and constructors
This commit is contained in:
11
tests/compiler/std/new.ts
Normal file
11
tests/compiler/std/new.ts
Normal file
@ -0,0 +1,11 @@
|
||||
class AClass {
|
||||
static aStaticField: i32 = 0;
|
||||
aField: i32 = 1;
|
||||
anotherField: f32 = 2;
|
||||
constructor(value: f32) {
|
||||
this.aField += 1;
|
||||
this.anotherField = value;
|
||||
}
|
||||
}
|
||||
|
||||
var aClass = new AClass(3);
|
Reference in New Issue
Block a user