Skip to content

Instantly share code, notes, and snippets.

@seraphr
Created July 1, 2012 12:06
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 seraphr/3028192 to your computer and use it in GitHub Desktop.
Save seraphr/3028192 to your computer and use it in GitHub Desktop.
ScalaGenerics...
class Container[_X]
def con[_Elem, _Con <: Container[_Elem]](a: _Con): _Con = a
// inferred type arguments [Nothing,Container[String]] do not conform to method con's type parameter bounds [_Elem,_Con <: Container[_Elem]]
con(new Container[String])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment