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

Pattern matcher outer check generation fooled by type aliases #7214

Closed
scabug opened this issue Mar 4, 2013 · 4 comments
Closed

Pattern matcher outer check generation fooled by type aliases #7214

scabug opened this issue Mar 4, 2013 · 4 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Mar 4, 2013

When I use a java library that returns a Vector, then use JavaConverters 'asScala' to convert the vector to the Scala equivalent and then try to match on the type in flatMap to do processing, I get a compiler crash.

no-symbol does not have an owner

This worked in Scala 2.9, but it hasn't worked in any version of 2.10.

Code would be something like this:
channel.ls.asScala.filter( _ match .flatMap( _ match {
case e: LsEntry => Some(rootPath + "/" + e.getFilename)
case s => None
})
}

If I add channel.ls.asInstanceOf[Vector[LsEntry]] to the code, the crash goes away.

Here is a very simple sbt project that demonstrates the problem.

https://github.com/OleTraveler/non-symbol-error

@scabug
Copy link
Author

scabug commented Mar 4, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7214?orig=1
Reporter: Travis Stevens (mrxtravis)
Affected Versions: 2.10.1-RC3
See #6813

@scabug
Copy link
Author

scabug commented Mar 5, 2013

@retronym said:
A workaround is to match on _: Outer#Inner, rather than on a type alias for the same type.

Fix for 2.10.2:

scala/scala#2199

@scabug
Copy link
Author

scabug commented Mar 5, 2013

@paulp said:
This is #6813, right?

@scabug
Copy link
Author

scabug commented Mar 5, 2013

@adriaanm said:
I think #6813 is a separate missing dealias.

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

No branches or pull requests

2 participants