-
Notifications
You must be signed in to change notification settings - Fork 194
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): lifting globals from inflight classes defined in preflight fails #5559
Conversation
Thanks for opening this pull request! 🎉
|
Console preview environment is available at https://wing-console-pr-5559.fly.dev 🚀 Last Updated (UTC) 2024-06-27 11:59 |
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-06-27 12:05 |
Signed-off-by: monada-bot[bot] <monabot@monada.co>
…nglang/wing into yoav/qualify_err_closure_lift
(inflight closures transformation now produces an inflight class)
…LifeableModuleType`
Because the type system can't distinguish between a closure class (which needs to be lifted) and a regular function type... Also lift on reference and not all call, by assuming a ref to a closure will actually call it later on, we can correctly lift (and setup permissions) for closures stored in collections (for example). This is a special exception to our qualification rules, since closures only have a single method (`handle`) so we can implicitly qualify it.
so we're sure the type is lifted
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
tools/hangar/__snapshots__/test_corpus/valid/bring_local.test.w_compile_tf-aws.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Rybicki <chrisr@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
…nglang/wing into yoav/qualify_err_closure_lift
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
Signed-off-by: monada-bot[bot] <monabot@monada.co>
…nglang/wing into yoav/qualify_err_closure_lift
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.75.15. |
…ight fails, take 2 (#6801) This is a resubmit of #5559 with the following fix: The `bringJs` helper function merges the brought module's type map into the bringing module's type map. During this merge there's a safety check to verify we don't overwrite one type over another if they have the same uids (should never happen). In reality there are cases where the same type in brought twice (two different files include the same .w file). I now detect these cases and ignore them in the safety check. Also added a test for this. ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
Fixes #2730
The wing compiler always generated dummy preflight classes for inflight classes defined preflight. This means such inflight classes have a lift map and therefore already include all the lift qualification information needed when their mehtods are used inflight. The problem was that our lift visitor ignored references to such classes because it looks for preflight expressions to lift, but references to inflight classes aren't preflight expressions.
This PR finds such references and creates a special lift with correct qualifications using dummy singleton preflight object representing the relevant inflight class. To get this working the following changes where made:
Resource
class has a satatic_singleton()
method_singleton()
method to get a preflight expression representing that object.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.