File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -566,6 +566,7 @@ impl InterfaceGenerator<'_> {
566566 uwrite ! (
567567 macro_src,
568568 "
569+ const _: () = {{
569570 #[doc(hidden)]
570571 #[export_name = \" {export_name}\" ]
571572 #[allow(non_snake_case)]
@@ -647,7 +648,8 @@ impl InterfaceGenerator<'_> {
647648 for param in params. iter ( ) {
648649 uwrite ! ( macro_src, "{param}," ) ;
649650 }
650- uwriteln ! ( macro_src, ")\n }}" ) ;
651+ uwriteln ! ( macro_src, ")\n }}" ) ; // close function call and function
652+ uwriteln ! ( macro_src, "\n }};" ) ; // close `const _: () = { ...`
651653
652654 let mut f = FunctionBindgen :: new ( self , params) ;
653655 f. gen . resolve . call (
Original file line number Diff line number Diff line change @@ -168,3 +168,36 @@ mod skip {
168168
169169 export_baz ! ( Component ) ;
170170}
171+
172+ mod symbol_does_not_conflict {
173+ wit_bindgen:: generate!( {
174+ inline: "
175+ package my:inline
176+
177+ interface foo1 {
178+ foo: func()
179+ }
180+
181+ interface foo2 {
182+ foo: func()
183+ }
184+
185+ world foo {
186+ export foo1
187+ export foo2
188+ }
189+ " ,
190+ } ) ;
191+
192+ struct Component ;
193+
194+ impl exports:: my:: inline:: foo1:: Foo1 for Component {
195+ fn foo ( ) { }
196+ }
197+
198+ impl exports:: my:: inline:: foo2:: Foo2 for Component {
199+ fn foo ( ) { }
200+ }
201+
202+ export_foo ! ( Component ) ;
203+ }
You can’t perform that action at this time.
0 commit comments