我正在尝试使用$Subtype
来键入mixin函数。我相信我的类型签名是正确的。我不断收到一些错误:
const MyMixin: MixinFunction = superclass => class extends superclass {};
^ Cannot extend `superclass` [1] with
`<<anonymous class>>` because `A` [2] is
not inheritable.
这是我的超级简单代码(on Try Flow):
type MixinFunction = <A>(superclass: Class<A>) => Class<$Subtype<A>>;
const MyMixin: MixinFunction = superclass => class extends superclass {};
如何使此代码正常运行?