Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistency in pattern matching between Idents and Selects after changes to stabilty/volatility in subtyping #8304

Closed
scabug opened this issue Feb 17, 2014 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 17, 2014

trait Universe {
  type Name >: Null <: AnyRef with NameApi
  trait NameApi

  type TermName >: Null <: TermNameApi with Name
  trait TermNameApi extends NameApi
}

object Test extends App {
  val u: Universe = ???
  import u._

  locally {
    val ScalaName: TermName = ???
    ??? match {
      case ScalaName => ???
    }
  }
}
t8300-patmat.scala:17: error: stable identifier required, but ScalaName found.
 Note that value ScalaName is not stable because its type, Test.u.TermName, is volatile.
      case ScalaName => ???
           ^
one error found
@scabug
Copy link
Author

scabug commented Feb 17, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8304?orig=1
Reporter: @xeno-by
Affected Versions: 2.11.0-M3

@scabug
Copy link
Author

scabug commented Feb 18, 2014

@adriaanm said:
It's been a while, but I thought we had fixed this. I'll at least see about diagnosing it this week.

@scabug
Copy link
Author

scabug commented Feb 18, 2014

@retronym said:
I've just pushed a commit to scala/scala#3545 which I believe corrects the oversight in #6815.

This example actually didn't compile underl 2.10.3, so I'm removing "regression" from the title. But we shouldn't ship with the inconsistency between Selects and Idents.

@scabug
Copy link
Author

scabug commented Feb 18, 2014

@xeno-by said:
I am sorry for labelling this as a regression. I guess I was using the old version of this test (without locally) to check whether it works for 2.10.4-SNAPSHOT.

@scabug
Copy link
Author

scabug commented Feb 18, 2014

@retronym said:
No matter, a good catch is a good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants