diff --git a/compiler/src/dmd/expressionsem.d b/compiler/src/dmd/expressionsem.d index 7d47f5bc56..19111e31ba 100644 --- a/compiler/src/dmd/expressionsem.d +++ b/compiler/src/dmd/expressionsem.d @@ -641,23 +641,23 @@ TupleDeclaration isAliasThisTuple(Expression e) Type t = e.type.toBasetype(); while (true) { - Dsymbol s = t.toDsymbol(null); - if (!s) - return null; - auto ad = s.isAggregateDeclaration(); - if (!ad) - return null; - s = ad.aliasthis ? ad.aliasthis.sym : null; - if (s && s.isVarDeclaration()) + if (Dsymbol s = t.toDsymbol(null)) { - TupleDeclaration td = s.isVarDeclaration().toAlias().isTupleDeclaration(); - if (td && td.isexp) - return td; - } - if (Type att = t.aliasthisOf()) - { - t = att; - continue; + if (auto ad = s.isAggregateDeclaration()) + { + s = ad.aliasthis ? ad.aliasthis.sym : null; + if (s && s.isVarDeclaration()) + { + TupleDeclaration td = s.isVarDeclaration().toAlias().isTupleDeclaration(); + if (td && td.isexp) + return td; + } + if (Type att = t.aliasthisOf()) + { + t = att; + continue; + } + } } return null; }