mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-12 06:21:29 +00:00
Properly resolve enum value siblings
This commit is contained in:
@ -14,6 +14,8 @@
|
||||
(global $enum/Mixed.FOUR i32 (i32.const 4))
|
||||
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
|
||||
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
|
||||
(global $enum/SelfReference.ZERO i32 (i32.const 0))
|
||||
(global $enum/SelfReference.ONE i32 (i32.const 1))
|
||||
(memory $0 1)
|
||||
(export "enum/Implicit.ZERO" (global $enum/Implicit.ZERO))
|
||||
(export "enum/Implicit.ONE" (global $enum/Implicit.ONE))
|
||||
@ -27,6 +29,8 @@
|
||||
(export "enum/Mixed.ONE" (global $enum/Mixed.ONE))
|
||||
(export "enum/Mixed.THREE" (global $enum/Mixed.THREE))
|
||||
(export "enum/Mixed.FOUR" (global $enum/Mixed.FOUR))
|
||||
(export "enum/SelfReference.ZERO" (global $enum/SelfReference.ZERO))
|
||||
(export "enum/SelfReference.ONE" (global $enum/SelfReference.ONE))
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $v)
|
||||
|
@ -27,3 +27,8 @@ export enum NonConstant {
|
||||
ZERO = getZero(), // cannot export a mutable global
|
||||
ONE // cannot export a mutable global (tsc doesn't allow this)
|
||||
}
|
||||
|
||||
export enum SelfReference {
|
||||
ZERO,
|
||||
ONE = ZERO + 1
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
(global $enum/Mixed.FOUR i32 (i32.const 4))
|
||||
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
|
||||
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
|
||||
(global $enum/SelfReference.ZERO i32 (i32.const 0))
|
||||
(global $enum/SelfReference.ONE i32 (i32.const 1))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
(memory $0 1)
|
||||
(export "enum/Implicit.ZERO" (global $enum/Implicit.ZERO))
|
||||
@ -29,6 +31,8 @@
|
||||
(export "enum/Mixed.ONE" (global $enum/Mixed.ONE))
|
||||
(export "enum/Mixed.THREE" (global $enum/Mixed.THREE))
|
||||
(export "enum/Mixed.FOUR" (global $enum/Mixed.FOUR))
|
||||
(export "enum/SelfReference.ZERO" (global $enum/SelfReference.ZERO))
|
||||
(export "enum/SelfReference.ONE" (global $enum/SelfReference.ONE))
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $enum/getZero (; 0 ;) (type $i) (result i32)
|
||||
@ -97,9 +101,11 @@
|
||||
ENUM: enum/Mixed
|
||||
FUNCTION_PROTOTYPE: enum/getZero
|
||||
ENUM: enum/NonConstant
|
||||
ENUM: enum/SelfReference
|
||||
[program.exports]
|
||||
ENUM: enum/Implicit
|
||||
ENUM: enum/Explicit
|
||||
ENUM: enum/Mixed
|
||||
ENUM: enum/NonConstant
|
||||
ENUM: enum/SelfReference
|
||||
;)
|
||||
|
Reference in New Issue
Block a user