File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -881,10 +881,6 @@ object TypeOps:
881881 }
882882
883883 def instantiate (): Type = {
884- // if there's a change in variance in type parameters (between subtype tp1 and supertype tp2)
885- // then we don't want to maximise the type variables in the wrong direction.
886- // For instance 15967, A[-Z] and B[Y] extends A[Y], we don't want to maximise Y to Any
887- maximizeType(protoTp1.baseType(tp2.classSymbol), NoSpan )
888884 maximizeType(protoTp1, NoSpan )
889885 wildApprox(protoTp1)
890886 }
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ object Inferencing {
417417 if safeToInstantiate then tvar.instantiate(fromBelow = v == - 1 )
418418 else {
419419 val bounds = TypeComparer .fullBounds(tvar.origin)
420- if bounds.hi <:< bounds.lo || bounds.hi.classSymbol.is(Final ) then
420+ if ( bounds.hi frozen_ <:< bounds.lo) || bounds.hi.classSymbol.is(Final ) then
421421 tvar.instantiate(fromBelow = false )
422422 else {
423423 // We do not add the created symbols to GADT constraint immediately, since they may have inter-dependencies.
Original file line number Diff line number Diff line change 1+ // scalac: -Werror
2+ sealed trait Get [X , + X2 <: X ]
3+ case class Bar [Y , Y2 <: Y ](value : Y2 ) extends Get [Y , Y2 ]
4+
5+ class Test :
6+ def t1 [Z , Z2 <: Z ](get : Get [Z , Z2 ]) = get match
7+ case Bar (_) =>
You can’t perform that action at this time.
0 commit comments