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
Repeated parameter A* doesn't behave like Seq[A] on a pattern match #5967
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5967?orig=1 |
@retronym said: |
Ryan Hendrickson (ryan.hendrickson_bwater) said: stabilize(tree2, pre2, mode, pt) to val tree3 = stabilize(tree2, pre2, mode, pt)
tree3 setType dropRepeatedParamType(tree3.tpe) Unless this is bad for some reason, it seems like it represents the general idea of "identifiers referring to repeated parameter symbols should have Seq type rather than type" better than fixing it ad-hoc for pattern matching. (And maybe—I haven't tried this, just a shot in the dark—it would mean you don't need dropRepeatedParamType inside widenIfNecessary anymore to ensure that |
@retronym said: |
@adriaanm said: |
Ryan Hendrickson (ryan.hendrickson_bwater) said: |
@adriaanm said: |
@retronym said: |
This doesn't compile:
But this does:
I think it's obvious, but per the spec, the identifier
a
should already have the type Seq[Int] inside the body off
in either case, yet in the first case, the compiler seems to think thata
has a type which is a strict subtype of Seq[Int] and which List does not extend.Seems related to (if not a dupe of) #4176.
The text was updated successfully, but these errors were encountered: