Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dmd/dmodule.d
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ extern (C++) final class Module : Package
if (doHdrGen)
hdrfile = setOutfilename(global.params.dihdr.name, global.params.dihdr.dir, arg, hdr_ext);

this.edition = Edition.min;
this.edition = global.params.edition;
}

extern (D) this(const(char)[] filename, Identifier ident, int doDocComment, int doHdrGen)
Expand Down
2 changes: 2 additions & 0 deletions compiler/src/dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,8 @@ bool parseCommandLine(const ref Strings arguments, const size_t argc, out Param
auto filename = p + 1+7+1+4;
files.push(filename);
params.editionFiles[filename] = params.edition;
// FIXME: params.edition should not be set when there's a filename
error("`-edition` is not supported with a filename yet");
}
}
else if (arg == "-fIBT")
Expand Down
10 changes: 10 additions & 0 deletions compiler/test/fail_compilation/edition_switch.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
REQUIRED_ARGS: -edition=2024
TEST_OUTPUT:
---
fail_compilation/edition_switch.d(10): Error: usage of identifer `body` as a keyword is obsolete. Use `do` instead.
---
*/

void test()
in { } body { }
Loading