- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Possible regression in the old and the new pattern matcher (SI-3968) and possibly fixed bugs (SI-3481, SI-3556, SI-2080)
Thu, 2011-12-01, 21:13
Hi,
I found the following issue:
array matching showing covariance
https://issues.scala-lang.org/browse/SI-3968
The following prints "1 1" but should print "2 2".
Well, now it prints “3 3”.
Is this a regression?
It seems like the following bugs might have been fixed, at least I can verify that the compiler rejects the unsound code of these tickets:
Unsound type projection
https://issues.scala-lang.org/browse/SI-3481
method's return type can't be inferred, Nothing is used (unsoundly)
https://issues.scala-lang.org/browse/SI-3556
It should not be possible to override concrete member types
https://issues.scala-lang.org/browse/SI-2080
Can someone verify that?
Thanks and bye,
Simon
I found the following issue:
array matching showing covariance
https://issues.scala-lang.org/browse/SI-3968
object Test { def f1(x: Any) = x match { case _: Array[AnyRef] => 1 case _: Array[String] => 2 case _ => 3 } def f2(x: Any) = if (x.isInstanceOf[Array[AnyRef]]) 1 else if (x.isInstanceOf[Array[String]]) 2 else 3 def main(args: Array[String]): Unit = { println(f1(args)) println(f2(args)) } }
The following prints "1 1" but should print "2 2".
Well, now it prints “3 3”.
Is this a regression?
It seems like the following bugs might have been fixed, at least I can verify that the compiler rejects the unsound code of these tickets:
Unsound type projection
https://issues.scala-lang.org/browse/SI-3481
method's return type can't be inferred, Nothing is used (unsoundly)
https://issues.scala-lang.org/browse/SI-3556
It should not be possible to override concrete member types
https://issues.scala-lang.org/browse/SI-2080
Can someone verify that?
Thanks and bye,
Simon