-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: grammar support for phase independent specifier (#6879)
First step towards implementing the `unphased` functions RFC (#1711) ## Checklist - [ ] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [ ] Description explains motivation and solution - [ ] 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)*.
- Loading branch information
Showing
11 changed files
with
387 additions
and
290 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
unphased class UnphasedClass {} | ||
// ^ Error: Unphased classes are not yet supported | ||
|
||
unphased interface UnphasedInterface {} | ||
// ^ Error: Unphased interfaces are not yet supported | ||
|
||
let unphasedFn = unphased () => { | ||
// ^ Error: Unphased functions are not yet supported | ||
log("Hello, world!"); | ||
}; | ||
|
||
let fnWithUnphasedParamType = (f: unphased (str): num) => { | ||
// ^ Error: Unphased functions are not yet supported | ||
}; | ||
|
||
let fnWithUnphasedReturnType = (): (unphased (str): num)? => { | ||
// ^ Error: Unphased functions are not yet supported | ||
return nil; | ||
}; | ||
|
||
class Foo { | ||
unphased myField: str; | ||
// ^ Error: Class fields cannot be unphased | ||
unphased new() {} | ||
// ^ Error: Class constructors cannot be unphased | ||
unphased myMethod() {} | ||
// ^ Error: Unphased functions are not yet supported | ||
} | ||
|
||
interface IFoo { | ||
unphased bar(): void; | ||
// ^ Error: Unphased methods on interfaces are not yet supported | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ | |
"class" | ||
"let" | ||
"new" | ||
(inflight_specifier) | ||
(phase_specifier) | ||
] @keyword | ||
|
||
[ | ||
|
Oops, something went wrong.