diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 7a29ac3f7a38..3079b26df6cd 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -1468,8 +1468,8 @@ object Parsers { * PolyFunType ::= HKTypeParamClause '=>' Type * | HKTypeParamClause ‘->’ [CaptureSet] Type -- under pureFunctions * FunTypeArgs ::= InfixType - * | `(' [ [ ‘[using]’ ‘['erased'] FunArgType {`,' FunArgType } ] `)' - * | '(' [ ‘[using]’ ‘['erased'] TypedFunParam {',' TypedFunParam } ')' + * | `(' [ [ ‘['erased'] FunArgType {`,' FunArgType } ] `)' + * | '(' [ ‘['erased'] TypedFunParam {',' TypedFunParam } ')' */ def typ(): Tree = val start = in.offset diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala index cc4433f75a68..df708057dd71 100644 --- a/compiler/src/dotty/tools/dotc/typer/Namer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala @@ -1122,7 +1122,10 @@ class Namer { typer: Typer => No("is already an extension method, cannot be exported into another one") else if targets.contains(alias) then No(i"clashes with another export in the same export clause") - else if sym.is(Override) then + else if sym.is(Override) || sym.is(JavaDefined) then + // The tests above are used to avoid futile searches of `allOverriddenSymbols`. + // Scala defined symbols can override concrete symbols only if declared override. + // For Java defined symbols, this does not hold, so we have to search anyway. sym.allOverriddenSymbols.find( other => cls.derivesFrom(other.owner) && !other.is(Deferred) ) match diff --git a/compiler/test/dotc/pos-test-pickling.blacklist b/compiler/test/dotc/pos-test-pickling.blacklist index 9888916a86c9..81c0d3e35d3a 100644 --- a/compiler/test/dotc/pos-test-pickling.blacklist +++ b/compiler/test/dotc/pos-test-pickling.blacklist @@ -22,6 +22,7 @@ i15922.scala t5031_2.scala i16997.scala i7414.scala +i17588.scala # Tree is huge and blows stack for printing Text i7034.scala diff --git a/tests/pos/i17588.scala b/tests/pos/i17588.scala new file mode 100644 index 000000000000..5ac63d0dcc05 --- /dev/null +++ b/tests/pos/i17588.scala @@ -0,0 +1,2 @@ +class StringBox(inner: String): + export inner.* \ No newline at end of file