File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/typer
tests/pos-java-interop/selectOnRaw Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2370,7 +2370,16 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
23702370 def adaptType (tp : Type ): Tree = {
23712371 val tree1 =
23722372 if ((pt eq AnyTypeConstructorProto ) || tp.typeParamSymbols.isEmpty) tree
2373- else tree.withType(tree.tpe.EtaExpand (tp.typeParamSymbols))
2373+ else {
2374+ val tp1 =
2375+ if (ctx.compilationUnit.isJava)
2376+ // Cook raw type
2377+ AppliedType (tree.tpe, tp.typeParams.map(Function .const(TypeBounds .empty)))
2378+ else
2379+ // Eta-expand higher-kinded type
2380+ tree.tpe.EtaExpand (tp.typeParamSymbols)
2381+ tree.withType(tp1)
2382+ }
23742383 if ((ctx.mode is Mode .Pattern ) || tree1.tpe <:< pt) tree1
23752384 else err.typeMismatch(tree1, pt)
23762385 }
Original file line number Diff line number Diff line change 1+ public class Test {
2+ public Outer .Inner foo () {
3+ return null ;
4+ }
5+ }
6+
7+ class Outer <A > {
8+ class Inner {}
9+ }
You can’t perform that action at this time.
0 commit comments