dcast.d: Remove goto (#20845)

This commit is contained in:
Dennis 2025-02-10 23:38:02 +01:00 committed by GitHub
parent 5170f3fb69
commit 14b1159e78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2738,7 +2738,7 @@ Expression castTo(Expression e, Scope* sc, Type t, Type att = null)
if (auto tsa = tb.isTypeSArray())
{
if (e.elements.length != tsa.dim.toInteger())
goto L1;
return visit(ae);
}
ae = e.copy().isArrayLiteralExp();
@ -2776,7 +2776,7 @@ Expression castTo(Expression e, Scope* sc, Type t, Type att = null)
const edim = e.elements.length;
const tbasedim = tbase.dim.toInteger();
if (edim > tbasedim)
goto L1;
return visit(ae);
ae = e.copy().isArrayLiteralExp();
ae.type = tbase; // https://issues.dlang.org/show_bug.cgi?id=12642
@ -2800,7 +2800,6 @@ Expression castTo(Expression e, Scope* sc, Type t, Type att = null)
ev = ev.expressionSemantic(sc);
return ev;
}
L1:
return visit(ae);
}