scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

scalap output invalid for inner classes/types #3555

Open scabug opened 14 years ago

scabug commented 14 years ago
~/code/scratch/scalap-inner: cat inner.scala 
object test {
  abstract class A {
    class B1
    type B2
    def b1: A#B1
    def b2: A#B2
  }

  trait C {
    def b1: A#B1
    def b2: A#B2
  }
}

~/code/scratch/scalap-inner: scalac -d out inner.scala && scalap -classpath out test
object test extends java.lang.Object with scala.ScalaObject {
  def this() = { /* compiled code */ }
  abstract class A extends java.lang.Object with scala.ScalaObject {
    def this() = { /* compiled code */ }
    class B1 extends java.lang.Object with scala.ScalaObject {
      def this() = { /* compiled code */ }
    }
    type B2
    def b1 : test.A.B1
    def b2 : B2
  }
  trait C extends java.lang.Object {
    def b1 : test.A.B1
    def b2 : B2
  }
}

There are two problems:

scabug commented 14 years ago

Imported From: https://issues.scala-lang.org/browse/SI-3555?orig=1 Reporter: @retronym

scabug commented 14 years ago

@retronym said: I'm working on this bug here: http://github.com/retronym/scala-starrless/commits/t3555

I fixed the [http://github.com/retronym/scala-starrless/commit/4131457c499ecf4f1c7438acc7d288776fbac246 test framework for scalap], and thought I had [http://github.com/retronym/scala-starrless/commit/17dc393f909f6ff8f76cccb7cd65a4f93896bedb fixed this bug], too.

But I realised that my [http://github.com/retronym/scala-starrless/commit/547515930a14616fe50687eb808096ee80b6e9c4 test case was wrong.]

scabug commented 14 years ago

@retronym said: I've also updated scalap to indicate if a parameter has a default:

http://github.com/retronym/scala-starrless/commit/f964d913d52a360bf52bae5c58c62fa61b4d1221

This is needed to fix:

http://youtrack.jetbrains.net/issue/SCL-2184

scabug commented 14 years ago

@retronym said: FYI, IntelliJ is now using scalap from http://github.com/retronym/scala-starrless/commits/t3555