-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): imported JSII types are considered defined after other types (and can't be referenced by them) #6221
Conversation
Thanks for opening this pull request! 🎉
|
Console preview environment is available at https://wing-console-pr-6221.fly.dev 🚀 Last Updated (UTC) 2024-04-12 11:18 |
BenchmarksComparison to Baseline 🟥⬜⬜⬜⬜⬜⬜⬜🟩⬜🟩⬜⬜
⬜ Within 1.5 standard deviations Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI. Results
Last Updated (UTC) 2024-04-12 11:23 |
Signed-off-by: monada-bot[bot] <[email protected]>
Thanks for contributing, @yoav-steinberg! This PR will now be added to the merge queue, or immediately merged if |
Congrats! 🚀 This was released in Wing 0.70.1. |
Fixes #6209
Related to #5683
Removed the statement index from JSII import spec so everything imported from a JSII module is considered define at the top level of the file. This makes types imported from JSII behave the same way as other types since #5683.
Note there's still a difference between how imported JSII types and other types behave in regards to whether they can be used before being defined: classes. In #5683 we avoided hoisting class types to the "top of the file" so you can't do something like:
But this PR makes JSII classes hoisted to the top so for them this will work:
I think in the long run the desired behavior is to hoist all class types. So I'm fine with this currently only working for JSII.
Checklist
pr/e2e-full
label if this feature requires end-to-end testingBy submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.