Skip to content

Instantly share code, notes, and snippets.

@smarter
Created March 18, 2016 05:03
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 smarter/507fe5987049addcd977 to your computer and use it in GitHub Desktop.
Save smarter/507fe5987049addcd977 to your computer and use it in GitHub Desktop.
abstract class A[T] {
object X {
def foo(x: T): T = x
}
}
object B extends A[Int] { // Change to String, fail as expected
}
object Test {
B.X.foo(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment