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
The syntax around lift()
statements is confusing
#6080
Labels
breaking-change
Fix expected to include a breaking change
🐛 bug
Something isn't working
📐 language-design
Language architecture
Milestone
Comments
Chriscbr
added
🐛 bug
Something isn't working
📐 language-design
Language architecture
breaking-change
Fix expected to include a breaking change
labels
Mar 27, 2024
5 tasks
mergify bot
pushed a commit
that referenced
this issue
May 19, 2024
fixes #6080 Initial implementation of the explicit lift statement as defined in the [rfc](https://github.com/winglang/wing/blob/main/docs/contributing/999-rfcs/2024-03-14-explicit-lift-qualification.md). ```wing let bucket = new cloud.Bucket(); inflight () => { let b = bucket; // Assing preflight object to inflight variable lift {bucket: put} { b.put("k","v"); // Within this block we can use the inflight variable because of the explicit lifting above } b.put("k","v"); // This is an error, because it's outside the explicit lift block and we can't figure out who `b` is // We can also define multiple lifts in a block and multiple ops per lift lift {bucket1: [put, get], bucket2: delete} { ... } // We can nest lift blocks lift {bucket1: put} { .. lift {bucket2: get} { .. } } // Type checker validates passed methods are really part of the inflight interface of the object lift {bucket: leak} {} //^ err: leak isn't an inflight method on type Bucket } ``` Breaking change: this is instead of the `lift()` builtin macro that was used for the same purpose. ## 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) - [x] 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)*.
Congrats! 🚀 This was released in Wing 0.74.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking-change
Fix expected to include a breaking change
🐛 bug
Something isn't working
📐 language-design
Language architecture
Use Case
This issue is for tracking the implementation for #5951
Proposed Solution
No response
Implementation Notes
No response
Component
Language Design
Community Notes
The text was updated successfully, but these errors were encountered: