Skip to content

Instantly share code, notes, and snippets.

@nuttycom
Last active December 22, 2015 11:48
Show Gist options
  • Save nuttycom/6467809 to your computer and use it in GitHub Desktop.
Save nuttycom/6467809 to your computer and use it in GitHub Desktop.
scala> def foo[T, Coll[T] <: Seq[T]] = ???
warning: there were 1 feature warning(s); re-run with -feature for details
foo: [T, Coll[T] <: Seq[T]]=> Nothing
scala> foo[Int, List[Int]]
<console>:9: error: List[Int] takes no type parameters, expected: one
foo[Int, List[Int]]
^
scala> type LA[A] = List[Int]
defined type alias LA
scala> foo[Int, LA]
<console>:10: error: type arguments [Int,LA] do not conform to method foo's type parameter bounds [T,Coll[T] <: Seq[T]]
foo[Int, LA]
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment