Closed
Description
=== What steps will reproduce the problem? ===
trait A {
def f() = println("A")
}
class B extends A {
def g() = for(i <- 0 until 1) super[A].f()
def h() = for(i <- 0 until 1) B.super[A].f()
}
val b = new B()
b.g() // ClassCastException
b.h() // ClassCastException
=== What is the expected behavior? ===
The expected output is
A
A
=== What do you see instead? ===
ClassCastException
is thrown, as the compiler tries to cast the anonymous function to A.
=== Additional information ===
http://groups.google.com/group/scala-user/browse_thread/thread/757e3c5efb85c607
=== What versions of the following are you using? ===
- Scala: 2.8.1
- Java: 1.6.0_20
- Operating system: Ubuntu Linux