Skip to content

Instantly share code, notes, and snippets.

@paulp
Created February 2, 2014 01:11
Show Gist options
  • Save paulp/8761663 to your computer and use it in GitHub Desktop.
Save paulp/8761663 to your computer and use it in GitHub Desktop.
// Thanks for inferring types which I can't even access, scala.
scala> def f[A, CC[X]](xs: CC[A]) = xs
warning: there were 1 feature warning(s); re-run with -feature for details
f: [A, CC[X]](xs: CC[A])CC[A]
scala> f(scala.collection.immutable.BitSet(1))
res0: scala.collection.AbstractSet[Int] = BitSet(1)
scala> var x: scala.collection.AbstractSet[Int] = res0
<console>:9: error: class AbstractSet in package collection cannot be accessed in package collection
var x: scala.collection.AbstractSet[Int] = res0
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment