Skip to content

Commit 92e64f2

Browse files
committed
reduced the nesting
1 parent ffe8fb4 commit 92e64f2

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

compiler/src/dmd/funcsem.d

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,21 +1002,21 @@ void funcDeclarationSemantic(Scope* sc, FuncDeclaration funcdecl)
10021002
auto p1 = params1[i];
10031003
auto p2 = params2[i];
10041004

1005-
// Check for scope difference
1006-
if ((p1.storageClass & STC.scope_) != (p2.storageClass & STC.scope_))
1005+
if ((p1.storageClass & STC.scope_) == (p2.storageClass & STC.scope_))
1006+
continue;
1007+
1008+
if (!(p2.storageClass & STC.scope_))
1009+
continue;
1010+
1011+
if (!hasScopeDifference)
10071012
{
1008-
if (p2.storageClass & STC.scope_)
1009-
{
1010-
if (!hasScopeDifference)
1011-
{
1012-
// Intended signature
1013-
errorSupplemental(funcdecl.loc, "Did you intend to override:");
1014-
errorSupplemental(funcdecl.loc, "`%s`", buf1.peekChars());
1015-
hasScopeDifference = true;
1016-
}
1017-
errorSupplemental(funcdecl.loc, "Parameter %d is missing `scope`", cast(int)(i + 1));
1018-
}
1013+
// Intended signature
1014+
errorSupplemental(funcdecl.loc, "Did you intend to override:");
1015+
errorSupplemental(funcdecl.loc, "`%s`", buf1.peekChars());
1016+
hasScopeDifference = true;
10191017
}
1018+
errorSupplemental(funcdecl.loc, "Parameter %d is missing `scope`",
1019+
cast(int)(i + 1));
10201020
}
10211021
}
10221022
}

0 commit comments

Comments
 (0)