mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 07:21:30 +00:00
Rename memory instructions; Rework constant handling
This commit is contained in:
15
tests/compiler/std/gc-integration.ts
Normal file
15
tests/compiler/std/gc-integration.ts
Normal file
@ -0,0 +1,15 @@
|
||||
class A {}
|
||||
class B {
|
||||
static readonly c: B = changetype<B>(8);
|
||||
static d: A = changetype<A>(16);
|
||||
}
|
||||
B.c;
|
||||
B.d;
|
||||
|
||||
var no_ref: usize = 64;
|
||||
var a_ref: A | null = changetype<A>(24);
|
||||
var b_ref: B = changetype<B>(32);
|
||||
|
||||
var i: i32 = 0;
|
||||
__gc_iterate_roots((ref: usize): void => { assert(<u32>ref == ++i << 3); });
|
||||
assert(i == 4);
|
Reference in New Issue
Block a user