scala - classOf[] for a higher-kinded type -
given class foo[f[_]]
, how class
object? usual syntax doesn't work:
scala> classof[foo[_]] <console>:9: error: _$1 takes no type parameters, expected: 1 classof[foo[_]] ^
neither does
scala> classof[foo[_[_]]] <console>:9: error: _$1 not take type parameters classof[foo[_[_]]] ^
ah, right. leaving in case looks it:
scala> classof[foo[f] forsome { type f[_] }] warning: there 1 feature warning(s); re-run -feature details res0: class[foo[_[_] <: any]] = class foo
Comments
Post a Comment