Skip to content

Commit

Permalink
Fix rebase of checkArithmetic (#20767)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel authored Jan 23, 2025
1 parent 864b574 commit 1a9848a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -14740,6 +14740,13 @@ private bool checkArithmetic(Expression e, EXP op)
error(e.loc, msg, EXPtoString(op).ptr, e.toChars(), e.type.toChars());
return true;
}

// FIXME: Existing code relies on adding / subtracting types in typeof() expressions:
// alias I = ulong; alias U = typeof(I + 1u);
// https://github.com/dlang/dmd/issues/20763
if (op == EXP.add || op == EXP.min)
return false;

return e.checkValue();
}

Expand Down

0 comments on commit 1a9848a

Please sign in to comment.