Skip to content

Commit edcae95

Browse files
committed
Require 2024 edition for error
1 parent ab01691 commit edcae95

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
@@ -2363,7 +2363,7 @@ extern (C++) final class CallExp : UnaExp
23632363
bool inDebugStatement; /// true if this was in a debug statement
23642364
bool ignoreAttributes; /// don't enforce attributes (e.g. call @gc function in @nogc code)
23652365
bool isUfcsRewrite; /// the first argument was pushed in here by a UFCS rewrite
2366-
bool fromOpAssignment; // set when operator overload method call from assignment
2366+
bool fromOpAssignment; // set when operator overload method call from assignment (2024 edition)
23672367
VarDeclaration vthis2; // container for multi-context
23682368
Expression loweredFrom; // set if this is the result of a lowering
23692369

compiler/src/dmd/expressionsem.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5305,7 +5305,8 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
53055305
{
53065306
result = e;
53075307
auto ce = e.isCallExp();
5308-
if (!ce)
5308+
// rvalue error in discardValue from 2024 edition
5309+
if (!ce || !sc.hasEdition(Edition.v2024))
53095310
return;
53105311
ce.fromOpAssignment = true;
53115312
}

0 commit comments

Comments
 (0)