This page is no longer maintained — Please continue to the home page at

Possible regression in the old and the new pattern matcher (SI-3968) and possibly fixed bugs (SI-3481, SI-3556, SI-2080)

No replies
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.

I found the following issue:

array matching showing covariance

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 = {

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

method's return type can't be inferred, Nothing is used (unsoundly)

It should not be possible to override concrete member types

Can someone verify that?

Thanks and bye,


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland