File tree 2 files changed +6
-1
lines changed
compiler/src/dotty/tools/dotc/typer
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 =>
1122
1122
No (" is already an extension method, cannot be exported into another one" )
1123
1123
else if targets.contains(alias) then
1124
1124
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.
1126
1129
sym.allOverriddenSymbols.find(
1127
1130
other => cls.derivesFrom(other.owner) && ! other.is(Deferred )
1128
1131
) 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