File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
test/junit/scala/reflect/internal Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -128,4 +128,15 @@ class TypesTest {
128128 // calling `apply` merges the prefix/args of the elements ot the RefinedType and rewraps in the existential
129129 assertEquals(" M[_1] forSome { type X; type _1 >: X with Int }" , T .baseTypeSeq.apply(1 ).toString)
130130 }
131+
132+ @ Test
133+ def testExistentialMerge (): Unit = {
134+ val ts = typeOf[Set [Any ]] :: typeOf[Set [X ] forSome { type X <: Y ; type Y <: Int }] :: Nil
135+ def merge (ts : List [Type ]) = mergePrefixAndArgs(ts, Variance .Contravariant , lubDepth(ts))
136+ val merged1 = merge(ts)
137+ val merged2 = merge(ts.reverse)
138+ assert(ts.forall(_ <:< merged1)) // use to fail before fix to mergePrefixAndArgs for existentials
139+ assert(ts.forall(_ <:< merged2))
140+ assert(merged1 =:= merged2)
141+ }
131142}
You can’t perform that action at this time.
0 commit comments