-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the
exports
key for packages-with-versions (#677)
Previously one location looking up `exports` would account for the version and another wouldn't which caused the `ERROR` case to leak through by accident. These are now kept in sync to ensure that the right errors get surfaced.
- Loading branch information
1 parent
f1e8c06
commit 08de0ea
Showing
2 changed files
with
33 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,6 @@ mod symbol_does_not_conflict { | |
bar: func() -> string | ||
} | ||
world foo { | ||
export foo1 | ||
export foo2 | ||
|
@@ -272,3 +271,32 @@ mod owned_resource_deref_mut { | |
} | ||
} | ||
} | ||
|
||
mod package_with_versions { | ||
wit_bindgen::generate!({ | ||
inline: " | ||
package my:[email protected] | ||
interface foo { | ||
resource bar { | ||
constructor() | ||
} | ||
} | ||
world baz { | ||
export foo | ||
} | ||
", | ||
exports: { | ||
"my:inline/[email protected]/bar": Resource | ||
} | ||
}); | ||
|
||
pub struct Resource; | ||
|
||
impl exports::my::inline::foo::GuestBar for Resource { | ||
fn new() -> Self { | ||
loop {} | ||
} | ||
} | ||
} |