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:
881
881
}
882
882
883
883
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 )
888
884
maximizeType(protoTp1, NoSpan )
889
885
wildApprox(protoTp1)
890
886
}
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ object Inferencing {
417
417
if safeToInstantiate then tvar.instantiate(fromBelow = v == - 1 )
418
418
else {
419
419
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
421
421
tvar.instantiate(fromBelow = false )
422
422
else {
423
423
// 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