-
-
Notifications
You must be signed in to change notification settings - Fork 664
Implement -edition=YYYY semantics
#22248
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,7 +150,9 @@ class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer | |
| error("module edition %lld must be in the range %d ... %d", edition, Edition.min, Edition.max); | ||
| edition = edition.min; | ||
| } | ||
| mod.edition = cast(Edition)edition; | ||
| // ModuleDeclaration edition can't lower -edition flag's edition | ||
| if (edition > mod.edition) | ||
|
||
| mod.edition = cast(Edition)edition; | ||
| nextToken(); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| /* | ||
| REQUIRED_ARGS: -edition=2024 | ||
| TEST_OUTPUT: | ||
| --- | ||
| fail_compilation/edition_switch.d(13): Error: usage of identifer `body` as a keyword is obsolete. Use `do` instead. | ||
| --- | ||
| */ | ||
|
|
||
| // test -edition can override a lower module declaration | ||
| module m 2023; | ||
|
|
||
| void test() | ||
| in { } body { } |
Uh oh!
There was an error while loading. Please reload this page.