Skip to content

Instantly share code, notes, and snippets.

@paulp
Last active August 29, 2015 14:00
Show Gist options
  • Save paulp/11197811 to your computer and use it in GitHub Desktop.
Save paulp/11197811 to your computer and use it in GitHub Desktop.
class A { def f = () => 1 }
class B extends A { override def f() = () => 2 }
class C extends B { override val f = () => 3 }
val c = new C
(c: C).f() // 3
(c: B).f() // () => Int
(c: A).f() // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment