Closed Michael-F-Bryan closed 2 years ago
It would be good to add a test case for the future :)
It would be good to add a test case for the future :)
Yeah, that's a good point although I'm not sure how much we would gain from it. Almost all of the code generated by wit-bindgen
's internals is untested and because of the imperative way it's been written, it's very hard to test the code generated for one component (e.g. a method signature) in isolation.
I could add another integration test, but because the NameError
bug depends on the order used to generate items, the test would be subtle and you wouldn't understand what it's checking without reading through this issue.
I was using
wit-bindgen-gen-wasmer-py
and noticed that you can get code like this:In this case,
Exports.from_path()
's return type referencesError
before theError
class has been defined, so we get aNameError
when importingbindings.py
.