Suppressing @unchecked warning for a higher-kinded existential type
In Scala 2.10, given class Foo[F[_]] , I can't write scala> x.isInstanceOf[Foo[_]] <console>:10: error: _$1 takes no type parameters, expected: one x.isInstanceOf[Foo[_]] ^ or scala> x.isInstanceOf[Foo[_[_]]] <console>:11: error: _$1 does not take type parameters x.isInstanceOf[Foo[_[_]]] ^ I can write x.isInstanceOf[Foo[F] forSome { type F[_]] } , which gives an unchecked warning. I've tried placing @unchecked annotation in different places, but none of them work: scala> x.isInstanceOf[Foo[H] @unchecked forSome {type H[_]}] <console>:11: warning: abstract type H in type Foo[H] @unchecked