mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
dcast.d: Remove goto (#20845)
This commit is contained in:
parent
5170f3fb69
commit
14b1159e78
1 changed files with 2 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue