File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +5
-4
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 )
@@ -1653,10 +1657,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
1653
1657
case SearchSuccess (inferred, _, _) =>
1654
1658
adapt(inferred, pt)
1655
1659
case failure : SearchFailure =>
1656
- if (
1657
- pt.isInstanceOf [ProtoType ] && ! failure.isInstanceOf [AmbiguousImplicits ] ||
1658
- tree.tpe.<:< (pt)(ctx.addMode(Mode .GADTflexible ))
1659
- ) tree
1660
+ if (pt.isInstanceOf [ProtoType ] && ! failure.isInstanceOf [AmbiguousImplicits ]) tree
1660
1661
else err.typeMismatch(tree, pt, failure)
1661
1662
}
1662
1663
}
You can’t perform that action at this time.
0 commit comments