Skip to content

Commit

Permalink
Handle mixin expressions as assert conditions
Browse files Browse the repository at this point in the history
For druntime's test/exceptions/src/assert_fail.d, which still needs a
few adaptations.
  • Loading branch information
kinke committed Apr 5, 2020
1 parent 6e193b6 commit dc63432
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dmd/expressionsem.d
Expand Up @@ -5821,6 +5821,12 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
}()
*/

// if the assert condition is a mixin expression, try to compile it
if (auto ce = exp.e1.isCompileExp()) {
if (auto e1 = compileIt(ce))
exp.e1 = e1;
}

const tok = exp.e1.op;
bool isEqualsCallExpression;
if (tok == TOK.call)
Expand Down

0 comments on commit dc63432

Please sign in to comment.