Aladdin - Scala Bugtracking
[#1183] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Burak Martin fixed 2007-06-18 14:56:14.0
subject outer symbols interference
code
import scala.testing.SUnit._

object Test extends TestConsoleMain {

  def suite = new TestSuite(
      new Test717
    )

  class Foo(j:Int) {
    case class Bar(i:Int)
  }

  
  class Test717 extends TestCase("#717 test path of case classes") {
    val foo1 = new Foo(1)

    override def runTest() = {
      val res = (foo1.Bar(2):Any) match {
        case foo1.Bar(2) => true   // (1)
      }
      assertTrue("ok", res);
    }
  }

  // (2)
  object Foo {
    class Bar(val x : String)
    
    def unapply(s : String) : Option[Bar] = Some(new Bar(s))
  }

}
what happened
lamppc31:/localhome/buraq/svn/scala.fallback> ./build/quick/bin/scala -classpath /tmp Test
#717 test path of case classes failed due to java.lang.NoSuchMethodError: Test$Foo$Bar.(LTest$Foo;I)V
what expected succesful execution - what is particularly annoying is that the bug goes away when uncommenting either (1) or (2) ... the code generated (1) always worked fine, until by accident, I added (2) to the same file. Hints at serious problem with our symbol table representation, IMO
[back to overview]
Changes of this bug report
Martin  edited on  2007-07-02 14:02:42.0
Martin  edited on  2007-07-02 14:05:15.0