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
packagetestclassF1() {
privatesealedabstractclassTprivatecaseclassA(m: Int) extendsTprivatecaseclassB() extendsTprivatecaseobjectCextendsT// No warnings hereprivatedeffoo(t: T) = t match {
caseA(m) => println("A:"+ m)
caseB() => println("B")
caseC=> println("C")
}
deftest(m: Int):Unit= {
foo(A(m))
foo(B())
foo(C)
}
}
classF2[M]() {
privatesealedabstractclassTprivatecaseclassA(m: M) extendsTprivatecaseclassB() extendsTprivatecaseobjectCextendsT// match may not be exhaustive. It would fail on the following input: Cprivatedeffoo(t: T) = t match {
caseA(m) => println("A:"+ m)
caseB() => println("B")
caseC=> println("C")
}
deftest(m: M):Unit= {
foo(A(m))
foo(B())
foo(C)
}
}
objectTest {
defmain(args: Array[String]):Unit= {
newF1().test(1)
newF2[Int]().test(1)
}
}
The text was updated successfully, but these errors were encountered:
Regressed in: scala/scala#2440
Excellent test case comes from this report: https://groups.google.com/d/msg/scala-language/cj5ussiwPX0/iZEBEQLRxIMJ
The text was updated successfully, but these errors were encountered: