Skip to content

Commit

Permalink
Set ThrowExp type in semantic routine (#20596)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkorpel authored Dec 24, 2024
1 parent 31bc99f commit 0b3cb48
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion compiler/src/dmd/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,6 @@ extern (C++) final class ThrowExp : UnaExp
extern (D) this(const ref Loc loc, Expression e)
{
super(loc, EXP.throw_, e);
this.type = Type.tnoreturn;
}

override ThrowExp syntaxCopy()
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -8126,6 +8126,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
{
import dmd.statementsem;

te.type = Type.tnoreturn;
if (throwSemantic(te.loc, te.e1, sc))
result = te;
else
Expand Down Expand Up @@ -14022,7 +14023,6 @@ Expression expressionSemantic(Expression e, Scope* sc)
if (!e.isDeleteExp()
&& !e.isRealExp()
&& !e.isCompoundLiteralExp()
&& !e.isThrowExp()
&& !e.isTypeExp()
&& !e.isVarExp()
)
Expand Down

0 comments on commit 0b3cb48

Please sign in to comment.