You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectTest {
typeE[+X<:AwithT[X]] =AwithT[X]
sealedtraitT[+X<:E[X]]
traitAextendsT[A]
traitBextendsAwithT[B]
deftest[E1<:E[E1], E2<:E[E2]](a: E[E1], b: E[E2]) =
(a, b) match {
case (_, _: B) =>case (_: B, _) =>case _ =>
}
}
Output
-- [E046] CyclicError:S.scala:4:23-----------------------------------------------------------------------------------4|sealedtraitT[+X<:E[X]]
|^|Cyclic reference involving typeE|| longer explanation available when compiling with`-explain`1 error found
Expectation
Same result as when switching order of E and T:
objectTest {
sealedtraitT[+X<:E[X]]
typeE[+X<:AwithT[X]] =AwithT[X]
traitAextendsT[A]
traitBextendsAwithT[B]
deftest[E1<:E[E1], E2<:E[E2]](a :E[E1], b :E[E2]) =
(a, b) match {
case (_, _ :B) =>case (_ :B, _) =>case _ =>
}
}
Compiler version
3.3.1-RC1-bin-SNAPSHOT-git-d4a8600
Minimized code
Output
Expectation
Same result as when switching order of
E
andT
:which compiles successfully.
Observed at scala/bug#12771
The text was updated successfully, but these errors were encountered: