Skip to content

Commit

Permalink
still enable type use syntax, only ignore their index
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Oct 16, 2024
1 parent 2ee9fcb commit d9c6a13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions benchmarks/wasm/loop_poly.wat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
i32.const 0
block (param i32 i32) (result i32 i32)
loop (type 1) (param i32) (result i32) ;; label = @1
;; this type use will be ignored for now
i32.const 1
i32.const 2
br 1 (;@1;)
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/wasm/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ class GSWasmVisitor extends WatParserBaseVisitor[WIR] {
if (ctx.typeUse != null) {
// TODO: explicit type use
val tyIndex = -1
VarBlockType(tyIndex, None)
val funcType = visitFuncType(ctx.funcType)
VarBlockType(tyIndex, Some(funcType))
} else if (ctx.funcType != null){
// abbreviation form
val ty = visitFuncType(ctx.funcType)
Expand Down

0 comments on commit d9c6a13

Please sign in to comment.