diff --git a/compiler/src/dmd/parse.d b/compiler/src/dmd/parse.d index bb2411825fa..5b73da1b976 100644 --- a/compiler/src/dmd/parse.d +++ b/compiler/src/dmd/parse.d @@ -2974,7 +2974,7 @@ class Parser(AST, Lexer = dmd.lexer.Lexer) : Lexer const tv = peekNext(); Loc loc; if (tpl && token.value == TOK.identifier && - (tv == TOK.comma || tv == TOK.rightParenthesis || tv == TOK.dotDotDot)) + (tv == TOK.comma || tv == TOK.rightParenthesis || tv == TOK.dotDotDot || tv == TOK.assign)) { Identifier id = Identifier.generateId("__T"); loc = token.loc; diff --git a/compiler/test/runnable/lambdadefault.d b/compiler/test/runnable/lambdadefault.d new file mode 100644 index 00000000000..f97971c4521 --- /dev/null +++ b/compiler/test/runnable/lambdadefault.d @@ -0,0 +1,5 @@ +alias fp = (x = 0) => x; +static assert(is(typeof(fp!int) : int function(int = 0))); +static assert(fp() == 0); + +int main() {}