https://dlang.org/spec/expression.html#FunctionLiteralBody
PrimaryExpression:
...
FunctionLiteral
FunctionLiteral:
...
FunctionLiteralBody
FunctionLiteralBody:
...
FunctionContractsopt BodyStatement
Says that
auto b = do {return true;}();
Is valid, which is not. Maybe It says that
auto a = in{assert(true);} do {return true;}();
would be correct but it's not either.
Note that in the rules BodyStatement is not a valid one. Its target anchor does not exist.
Comment #1 by b2.temp — 2019-05-14T00:59:45Z
BodyStatement is probably for https://dlang.org/spec/function.html#SpecifiedFunctionBody
There are two options:
1. The easy way, remove the rule
2. Fix the compiler to allow `FunctionContractsopt SpecifiedFunctionBody` as subrule of FunctionLiteralBody