-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compiler)!: explicit lift qualification statement (#6400)
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)*.
- Loading branch information
1 parent
ac61766
commit d9a9ddf
Showing
28 changed files
with
767 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.