-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: compile an async fn #437
Comments
I failed to reproduce on my side. |
I cannot reproduce the issue neither. You may try the following:
|
I moved it into the pkg directory, and then the compilation passed without errors. However, if I change I don't know how to output a test in WAT format. When I run
|
I still can't reproduce with your new setting. But your description may indicate that the bug only occur in debug mode. Have you tried The |
I have ran
After that, run again (func $$username/project1.f.*async_driver.fn/1
(source_name "$username/project1.f.*async_driver.fn")
(param $*env/311 (source_name "*env") (source_type unit) i32)
(param $*state/230 (source_name "*state") (ref $moonbit.enum)) (result i32)
(local $*state/231 (source_name "*state") (ref $moonbit.enum))
(local $**arm/34/232 (source_name "**arm/34")
(ref $$username/project1.f.State.*arm/34))
(local $*cont/233 (source_name "*cont") (ref $<<Int*Int>>=>Unit))
(local $ff/234 (source_name "ff") (ref $<>=>Unit))
(local $*State_1/235 (source_name "*State_1")
(ref $$username/project1.f.State.State_1))
(local $*cont/236 (source_name "*cont") (ref $<<Int*Int>>=>Unit))
(local $*cont_param/237 (source_name "*cont_param") (ref $moonbit.enum))
(local $*bind/238 (source_name "*bind") (ref $moonbit.enum))
(local $*Some/239 (source_name "*Some") (ref $Option<<>=>Unit>.Some))
(local $*x/240 (source_name "*x") (ref $<>=>Unit))
(local $tag/338 (source_name "tag") i32)
(local $tag/339 (source_name "tag") i32) (prologue_end)
(local.get $*state/230)
(loop $loop:241 (param (ref $moonbit.enum)) (local.tee $*state/231)
(struct.get $moonbit.enum 0) (local.set $tag/338)
(if (i32.eq (local.get $tag/338) (i32.const 0))
(then (local.get $*state/231)
(ref.cast (ref $$username/project1.f.State.*arm/34))
(local.tee $**arm/34/232)
(struct.get $$username/project1.f.State.*arm/34 2) (local.set $*cont/233)
(local.get $**arm/34/232)
(struct.get $$username/project1.f.State.*arm/34 1) (local.set $ff/234)
(source_pos username/project1 bug.mbt 15 6) (i32.const 0)
(source_pos username/project1 bug.mbt 15 16) (drop)
(local.get $*cont/233) (source_pos username/project1 bug.mbt 16 6)
(call $throw) (unreachable)
(struct.get $<<Int*Int>>=>Unit 0 (local.get $*cont/233))
(call_ref $<<Int*Int>>=>Unit-sig) (drop))
(else (local.get $*state/231)
(ref.cast (ref $$username/project1.f.State.State_1))
(local.tee $*State_1/235)
(struct.get $$username/project1.f.State.State_1 2) (local.set $*cont/236)
(local.get $*State_1/235)
(struct.get $$username/project1.f.State.State_1 1)
(local.set $*cont_param/237) (source_pos username/project1 bug.mbt 13 2)
(local.get $*cont_param/237) (local.set $*bind/238)
(local.get $*cont/236) (local.get $*bind/238)
(struct.get $moonbit.enum 0) (local.set $tag/339)
(if (i32.eq (local.get $tag/339) (i32.const 1))
(then (local.get $*bind/238) (ref.cast (ref $Option<<>=>Unit>.Some))
(local.tee $*Some/239) (struct.get $Option<<>=>Unit>.Some 1)
(local.set $*x/240)
(struct.new $$username/project1.f.State.*arm/34 (i32.const 0)
(local.get $*x/240) (local.get $*cont/236))
(br $loop:241))
(else (source_pos username/project1 bug.mbt 18 12) (call $throw)
(unreachable)))
(i32.const 0) (struct.get $<<Int*Int>>=>Unit 0 (local.get $*cont/236))
(call_ref $<<Int*Int>>=>Unit-sig)
(source_pos username/project1 bug.mbt 19 3) (drop))))
(i32.const 0)) At this point, when running
|
It is indeed related to the debug mode. When I change |
running
moon run --target wasm-gc bug.mbt
bug.mbt
:output:
moon version --all
:The error only occurs when compiling to wasm-gc.
The text was updated successfully, but these errors were encountered: