Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expressionsem.d reduce indentation #16844

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -3933,35 +3933,37 @@
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;

Check warning on line 3957 in compiler/src/dmd/expressionsem.d

View check run for this annotation

Codecov / codecov/patch

compiler/src/dmd/expressionsem.d#L3957

Added line #L3957 was not covered by tests

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;
}
}
}
Expand Down
Loading