File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
448
448
return typed(untpd.Apply (untpd.TypedSplice (arg), tree.expr), pt)
449
449
case _ =>
450
450
}
451
+ case tref : TypeRef if tref.symbol.isClass && ! ctx.isAfterTyper =>
452
+ val setBefore = ctx.mode is Mode .GADTflexible
453
+ tpt1.tpe.<:< (pt)(ctx.addMode(Mode .GADTflexible ))
454
+ if (! setBefore) ctx.retractMode(Mode .GADTflexible )
451
455
case _ =>
452
456
}
453
457
ascription(tpt1, isWildcard = true )
Original file line number Diff line number Diff line change
1
+ class Term [A ]
2
+ class Number (val n : Int ) extends Term [Int ]
3
+ object Test {
4
+ def f [B ](t : Term [B ]): B = t match {
5
+ case y : Number => y.n
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments