File tree Expand file tree Collapse file tree 6 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 6 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2377,7 +2377,16 @@ class Typer extends Namer
23772377 def adaptType (tp : Type ): Tree = {
23782378 val tree1 =
23792379 if ((pt eq AnyTypeConstructorProto ) || tp.typeParamSymbols.isEmpty) tree
2380- else tree.withType(tree.tpe.EtaExpand (tp.typeParamSymbols))
2380+ else {
2381+ val tp1 =
2382+ if (ctx.compilationUnit.isJava)
2383+ // Cook raw type
2384+ AppliedType (tree.tpe, tp.typeParams.map(Function .const(TypeBounds .empty)))
2385+ else
2386+ // Eta-expand higher-kinded type
2387+ tree.tpe.EtaExpand (tp.typeParamSymbols)
2388+ tree.withType(tp1)
2389+ }
23812390 if ((ctx.mode is Mode .Pattern ) || tree1.tpe <:< pt) tree1
23822391 else err.typeMismatch(tree1, pt)
23832392 }
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+ }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments