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
2370
2370
def adaptType (tp : Type ): Tree = {
2371
2371
val tree1 =
2372
2372
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
+ }
2374
2383
if ((ctx.mode is Mode .Pattern ) || tree1.tpe <:< pt) tree1
2375
2384
else err.typeMismatch(tree1, pt)
2376
2385
}
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