File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1374,9 +1374,10 @@ trait Checking {
13741374 () // do nothing; we already have reported an error that overloaded variants cannot have default arguments
13751375 else if decl.is(Synthetic ) then doubleDefError(other, decl)
13761376 else doubleDefError(decl, other)
1377- if decl.hasDefaultParams && other.hasDefaultParams then
1378- report.error(em " two or more overloaded variants of $decl have default arguments " , decl.srcPos)
1379- decl.resetFlag(HasDefaultParams )
1377+ // Check for conflicting default arguments only if they actually conflict
1378+ if decl.hasDefaultParams && other.hasDefaultParams then
1379+ report.error(em " two or more overloaded variants of $decl have default arguments " , decl.srcPos)
1380+ decl.resetFlag(HasDefaultParams )
13801381 if ! excludeFromDoubleDeclCheck(decl) then
13811382 seen(decl.name) = decl :: seen(decl.name)
13821383
You can’t perform that action at this time.
0 commit comments