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

Compiler crash in 2.10.1-RC2 (regression) #7223

Closed
scabug opened this issue Mar 6, 2013 · 10 comments
Closed

Compiler crash in 2.10.1-RC2 (regression) #7223

scabug opened this issue Mar 6, 2013 · 10 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 6, 2013

Compiler crashes on my project, with "no-symbol does not have an owner". Happens both in IDE and SBT. 2.10.0-RC2 is fine, 2.10.1-RC2 is not. I have attached the "last" output from SBT. This was previously discussed in #6921, but I was asked to open a new issue, so here it is...

@scabug
Copy link
Author

scabug commented Mar 6, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7223?orig=1
Reporter: Andreas W (andreasw)
Affected Versions: 2.10.1-RC2, 2.10.1
See #7176, #6666
Attachments:

@scabug
Copy link
Author

scabug commented Mar 6, 2013

@retronym said:
In case you didn't see it, the troublesome code is in "src/com/firefly/firecode/gui/PlateView.scala".

@scabug
Copy link
Author

scabug commented Mar 7, 2013

Andreas W (andreasw) said (edited on Mar 7, 2013 4:55:53 PM UTC):
I managed to boil it down to a few lines. The below crashes the compiler for me in the newest edition of the IDE, which I believe is using 2.10.1-RC2. Highly likely it also crashes in SBT. The last reduction before I extracted it from my project entirely did so, under 2.10.1-RC1. Where there are nulls, there was previously other code that I removed during the reduction, so the nulls aren't it. I also changed the names of all classes and most variables to protect the innocent.

Please let me know if this works for you!

package scala.crash

class A {
  class A1 {
    case class A11(i: Int, j: Int) {
      lazy val a11: Option[C] = null
    }
    
    class A12(f: (Int, Int)=>A11) extends
      D((i, j, id, rep) => {
        for (x <- Some(f(i, j)); s<-x.a11) yield new B.B1(x.i, x.j) {}
      })
  }
}

object B {
  class B1(val row: Int, val col: Int) 
    extends C 
  {
     val b1: C = null
  }
}

trait C {
}

class D[T](t: (Int, Int, Int, Int)=>Option[T]) {
}

@scabug
Copy link
Author

scabug commented Mar 7, 2013

Andreas W (andreasw) said (edited on Mar 7, 2013 4:56:27 PM UTC):
Not sure if this helps, but what I ended out doing in my code is define a method in class A1 to compute the anonymous function passed in the constructor to D, like so:

class A1 {
  ...
  def ff(f: (Int, Int)=>A11): (Int, Int, Int, Int)=>Option[B.B1] =
    (i, j, id, rep) => {
      for (x <- Some(f(i, j)); s<-x.a11) yield new B.B1(x.i, x.j) {}
    }
  class A12(f: (Int, Int)=>A11) extends D(ff(f))
}

That averted the crash.

@scabug
Copy link
Author

scabug commented Mar 8, 2013

@retronym said:
Regressed in #6666 / fd6125428af90b02cb8969a53586f3551e275b0f.

@scabug
Copy link
Author

scabug commented Mar 8, 2013

@retronym said:
A workaround is to structure the code as follows:

package scala.crash

class A {
  class A1 {
    case class A11(i: Int, j: Int) {
      lazy val a11: Option[C] = null
    }

    class A12(f: (Int, Int)=>A11) extends
      D(toF4(f))

    def toF4(f: (Int, Int)=>A11) = (i: Int, j: Int, id: Int, rep: Int) => {
      for (x <- Some(f(i, j)); s<-x.a11) yield new B.B1(x.i, x.j) {}
    }
  }
}

object B {
  class B1(val row: Int, val col: Int)
    extends C
  {
     val b1: C = null
  }
}

trait C {
}

class D[T](t: (Int, Int, Int, Int)=>Option[T]) {
}

@scabug
Copy link
Author

scabug commented Mar 8, 2013

@retronym said:
Minimized:

package scala.crash

object Crash extends D(() => {
  (x: Int) => {() => { new { x.toString } }}
})

class D(a: Any)

@scabug
Copy link
Author

scabug commented Mar 11, 2013

@adriaanm said:
As there's a workaround and we're very late in the RC cycle, scheduling for 2.10.2-RC1

@scabug
Copy link
Author

scabug commented May 20, 2013

@JamesIry said:
2.10.2 is about to be cut. Kicking down the road and un-assigning to foster work stealing.

@scabug
Copy link
Author

scabug commented Aug 28, 2013

@retronym said:
PR: scala/scala#2884

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

No branches or pull requests

2 participants