From 7f061d63893a7c2bb857027308d27e1e7fa2a409 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Mon, 16 Sep 2024 15:06:25 +0100 Subject: [PATCH] expressionsem.d reduce indentation --- compiler/src/dmd/expressionsem.d | 52 +++++++++++++++++--------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/compiler/src/dmd/expressionsem.d b/compiler/src/dmd/expressionsem.d index 386643ae7c85..eb21f9398a6b 100644 --- a/compiler/src/dmd/expressionsem.d +++ b/compiler/src/dmd/expressionsem.d @@ -3933,35 +3933,37 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor if (!sc2.scopesym) continue; - if (auto ss = sc2.scopesym.isWithScopeSymbol()) + auto ss = sc2.scopesym.isWithScopeSymbol(); + if (!ss) + continue; + + if (ss.withstate.wthis) { - if (ss.withstate.wthis) + Expression e; + e = new VarExp(exp.loc, ss.withstate.wthis); + e = new DotIdExp(exp.loc, e, exp.ident); + e = e.trySemantic(sc); + if (e) { - Expression e; - e = new VarExp(exp.loc, ss.withstate.wthis); - e = new DotIdExp(exp.loc, e, exp.ident); - e = e.trySemantic(sc); - if (e) - { - result = e; - return; - } + result = e; + return; } - // Try Type.opDispatch (so the static version) - else if (ss.withstate.exp && ss.withstate.exp.op == EXP.type) + } + // Try Type.opDispatch (so the static version) + else if (ss.withstate.exp && ss.withstate.exp.op == EXP.type) + { + Type t = ss.withstate.exp.isTypeExp().type; + if (!t) + continue; + + Expression e; + e = new TypeExp(exp.loc, t); + e = new DotIdExp(exp.loc, e, exp.ident); + e = e.trySemantic(sc); + if (e) { - if (Type t = ss.withstate.exp.isTypeExp().type) - { - Expression e; - e = new TypeExp(exp.loc, t); - e = new DotIdExp(exp.loc, e, exp.ident); - e = e.trySemantic(sc); - if (e) - { - result = e; - return; - } - } + result = e; + return; } } }