Skip to content

Instantly share code, notes, and snippets.

@lrytz
Last active September 15, 2016 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lrytz/c6ca6f5a4eb58636b633811b6350720f to your computer and use it in GitHub Desktop.
Save lrytz/c6ca6f5a4eb58636b633811b6350720f to your computer and use it in GitHub Desktop.
class A {
def f = 1
}
trait T extends A
class B extends A {
override def f = 2
}
class C extends B with T {
// according to linearization, this should select `f` in
def t = super.f
// def u = super[T].f // in 2.12 this yields "error: cannot emit super call"
}
object Test {
def main(args: Array[String]): Unit = {
// prints 2
println(new C().t)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment