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

Interaction of specialization and pattern matching: value has NullaryMethodType in backend #10096

Open
scabug opened this issue Dec 6, 2016 · 2 comments

Comments

@scabug
Copy link

scabug commented Dec 6, 2016

Reported by Eugeniy D on scala-internals.

class C[@specialized(Double) A]()
class D[@specialized(Double) A]() {
    val (a, b) = (1, 2)
    val c = new C[A]()
}

Crashes the backend. In 2.12, GenBCode: unexpected type representation reached the backend: => Tuple2. In 2.11 during GenICode: error: Unknown type: => Tuple2, => Tuple2.

  <specialized> class D$mcD$sp extends D {
...
    <specialized> def <init>(): D$mcD$sp = {
      D$mcD$sp.super.<init>();
      D$mcD$sp.this.x$1 = {
        private[this] val x1: Tuple2 = (new Tuple2$mcII$sp(1, 2): Tuple2);
        case4(){
          if (D$mcD$sp.this.x1.ne(null))
...

when generating code for loading D$mcD$sp.this.x1, its sym.info is a NullaryMethodType. Note that this is in the specialized subclass D$mcD$sp, the class D also has a definition x1 which seems to have a good type. Maybe a bug in duplicators? Just a guess.

@scabug
Copy link
Author

scabug commented Dec 6, 2016

Imported From: https://issues.scala-lang.org/browse/SI-10096?orig=1
Reporter: @lrytz
Affected Versions: 2.11.8, 2.12.1

@scabug
Copy link
Author

scabug commented Jan 6, 2017

@lrytz said:
description of duplicate #8320: "I narrowed it down to a [@specialized(Double) T: ClassTag] on a case class"

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

1 participant