Type.create() error "Can't fetch on parametric type 'AssetSlotConnection'"

#1

When I try to run Type.create() on a type that extends Asset<AssetSlot, AssetSlotConnection>, I get the following error:

“Can’t fetch on parametric type ‘AssetSlotConnection’”

It seems like the object still does get created, but why does this error message appear and is there anything I can do to fix it?

0 Likes

#2

I solved the problem by defining “dummy” types that extend Asset, Slot, and AssetSlotConnection and connecting them to one another just like the original types do:

ConcreteAsset extends Asset<ConcreteSlot, ConcreteAssetSlotConnection>
ConcreteSlot extends Slot<ConcreteAsset, ConcreteAssetSlotConnection>
ConcreteSlotConnection extends AssetSlotConnection<ConcreteAsset, ConcreteSlot>

Then just make your type extend ConcreteAsset instead of Asset and you should be good to go

0 Likes