Aladdin - Scala Bugtracking
[#54] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Matthias Martin fixed 2003-07-07 13:50:22.0
subject Inner case classes
code
class A {
  case class B(x: C) extends A {}
  class C {}
}
what happened
This correct program yields the following compiler message:
S.scala:2: type mismatch;
 found   : A.this.C
 required: B.this.C
        case class B(x: C) extends A {}
                      ^
what expected No compile-time error.
[back to overview]
Changes of this bug report
Martin  edited on  2003-07-08 17:07:23.0
Burak  edited on  2006-10-24 16:03:12.0
I reopen this bug, with the slighlty changed program
class A {
  case class B(x: C) extends A { val z: A.this.C = x }
  class C {}
}
The type A.this.C for parameter x is correct. The output
testing: test/files/pos/bug54.scala                                   [FAILED]
1,6d0
 /localhome/buraq/svn/scala/test/files/pos/bug54.scala:2 error: type mismatch;
  found   : B.this.C
  required: A.this.C
   case class B(x: C) extends A { val z: A.this.C = x }
                                                    ^
< one error found

Martin  edited on  2006-10-25 18:27:37.0