Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wit-parser: Fix types leaking across interfaces (#822)
This fixes an internal bug where types were accidentally leaking across interfaces, panicking when used. This commit fixes the issue by properly fixing the "reset the state" after resolution of each interface and then additionally adds some more testing per-interface to the `ui` tests.
- Loading branch information
1 parent
40ef021
commit e15e768
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
world foo { | ||
import foo: interface { | ||
a: func() -> list<u8> | ||
} | ||
default export interface { | ||
a: func() -> tuple<list<u8>> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "foo", | ||
"default": { | ||
"types": [ | ||
{ | ||
"idx": 0, | ||
"list": "u8" | ||
}, | ||
{ | ||
"idx": 1, | ||
"tuple": { | ||
"types": [ | ||
"type-0" | ||
] | ||
} | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"name": "a", | ||
"params": [], | ||
"results": [ | ||
"type-1" | ||
] | ||
} | ||
] | ||
}, | ||
"imports": [ | ||
[ | ||
"foo", | ||
{ | ||
"types": [ | ||
{ | ||
"idx": 0, | ||
"list": "u8" | ||
} | ||
], | ||
"functions": [ | ||
{ | ||
"name": "a", | ||
"params": [], | ||
"results": [ | ||
"type-0" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |