File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1122,7 +1122,10 @@ class Namer { typer: Typer =>
11221122 No (" is already an extension method, cannot be exported into another one" )
11231123 else if targets.contains(alias) then
11241124 No (i " clashes with another export in the same export clause " )
1125- else if sym.is(Override ) then
1125+ else if sym.is(Override ) || sym.is(JavaDefined ) then
1126+ // The tests above are used to avoid futile searches of `allOverriddenSymbols`.
1127+ // Scala defined symbols can override concrete symbols only if declared override.
1128+ // For Java defined symbols, this does not hold, so we have to search anyway.
11261129 sym.allOverriddenSymbols.find(
11271130 other => cls.derivesFrom(other.owner) && ! other.is(Deferred )
11281131 ) match
Original file line number Diff line number Diff line change 1+ class StringBox (inner : String ):
2+ export inner .*
You can’t perform that action at this time.
0 commit comments