Skip to content

Commit 5ed5af9

Browse files
committed
Require 2024 edition for error
1 parent 99a5d11 commit 5ed5af9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

compiler/src/dmd/expression.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ extern (C++) final class CallExp : UnaExp
23622362
bool inDebugStatement; /// true if this was in a debug statement
23632363
bool ignoreAttributes; /// don't enforce attributes (e.g. call @gc function in @nogc code)
23642364
bool isUfcsRewrite; /// the first argument was pushed in here by a UFCS rewrite
2365-
bool fromOpAssignment; // set when operator overload method call from assignment
2365+
bool fromOpAssignment; // set when operator overload method call from assignment (2024 edition)
23662366
VarDeclaration vthis2; // container for multi-context
23672367
Expression loweredFrom; // set if this is the result of a lowering
23682368

compiler/src/dmd/expressionsem.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5278,7 +5278,8 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
52785278
{
52795279
result = e;
52805280
auto ce = e.isCallExp();
5281-
if (!ce)
5281+
// rvalue error in discardValue from 2024 edition
5282+
if (!ce || !sc.hasEdition(Edition.v2024))
52825283
return;
52835284
ce.fromOpAssignment = true;
52845285
}

0 commit comments

Comments
 (0)