diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index c9458c547aec..3addf72b2d73 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -2370,7 +2370,16 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit def adaptType(tp: Type): Tree = { val tree1 = if ((pt eq AnyTypeConstructorProto) || tp.typeParamSymbols.isEmpty) tree - else tree.withType(tree.tpe.EtaExpand(tp.typeParamSymbols)) + else { + val tp1 = + if (ctx.compilationUnit.isJava) + // Cook raw type + AppliedType(tree.tpe, tp.typeParams.map(Function.const(TypeBounds.empty))) + else + // Eta-expand higher-kinded type + tree.tpe.EtaExpand(tp.typeParamSymbols) + tree.withType(tp1) + } if ((ctx.mode is Mode.Pattern) || tree1.tpe <:< pt) tree1 else err.typeMismatch(tree1, pt) } diff --git a/tests/pos-java-interop/selectOnRaw/Test.java b/tests/pos-java-interop/selectOnRaw/Test.java new file mode 100644 index 000000000000..b30b3acaa21e --- /dev/null +++ b/tests/pos-java-interop/selectOnRaw/Test.java @@ -0,0 +1,9 @@ +public class Test { + public Outer.Inner foo() { + return null; + } +} + +class Outer { + class Inner {} +} diff --git a/tests/pending/pos/java-interop/t1263/Test.java b/tests/pos-java-interop/t1263/t1263/Test.java similarity index 100% rename from tests/pending/pos/java-interop/t1263/Test.java rename to tests/pos-java-interop/t1263/t1263/Test.java diff --git a/tests/pending/pos/java-interop/t1263/test.scala b/tests/pos-java-interop/t1263/t1263/test.scala similarity index 100% rename from tests/pending/pos/java-interop/t1263/test.scala rename to tests/pos-java-interop/t1263/t1263/test.scala diff --git a/tests/pending/pos/java-interop/t1745/J.java b/tests/pos-java-interop/t1745/J.java similarity index 100% rename from tests/pending/pos/java-interop/t1745/J.java rename to tests/pos-java-interop/t1745/J.java diff --git a/tests/pending/pos/java-interop/t1745/S.scala b/tests/pos-java-interop/t1745/S.scala similarity index 100% rename from tests/pending/pos/java-interop/t1745/S.scala rename to tests/pos-java-interop/t1745/S.scala