-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tuple specialisation doesn't correctly see type #18638
Labels
Comments
klaeufer
added
itype:bug
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Oct 2, 2023
bishabosha
added
area:transform
and removed
stat:needs triage
Every issue needs to have an "area" and "itype" label
labels
Oct 16, 2023
Looks like a problem in compiler/src/dotty/tools/dotc/transform/SpecializeTuples.scala:40 |
bishabosha
changed the title
2-ary type alias for Tuple2 can cause ClassCastException (confusion between type parameter and element type of tuple)
Tuple specialisation doesn't correctly see type
Oct 16, 2023
Minimizationtype U[H, T] = (Unit, Unit)
def test1(u: U[Int, Int]) = u._1
def test2(u: (Unit, Unit)) = u._1 Compiled with package <empty> {
final lazy module val Test$package: Test$package = new Test$package()
@SourceFile("t/Test.scala") final module class Test$package() extends Object()
{
private def writeReplace(): AnyRef =
new scala.runtime.ModuleSerializationProxy(classOf[Test$package.type])
type U = [H, T] =>> (Unit, Unit)
def test1(u: U[Int, Int]): Unit = u._1$mcI$sp // issue here
def test2(u: (Unit, Unit)): Unit = u._1
}
} |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
Welcome to Scala 3.3.1 (17.0.8.1, Java OpenJDK 64-Bit Server VM).
Minimized code
Output
Expectation
Additional observations
The text was updated successfully, but these errors were encountered: