❔ generic class in generic method
im trying to have this method:
where each thing that inherits Prefab has a PrefabArgs generic type thing, like, a Prefab "player" could be Player<PlayerPrefabArgs>, and you can call this method like
but the problem im having is this just isnt working how id like it to, i have to do
like it doesnt know how to infer the type or something
8 Replies
How could it infer the type of T when you only pass it something of type C?
because i tell it T
T is a placeholder for an actual type
player is class Player : Prefab<PlayerPrefabArgs>
you cannot have it partially infer the generic arguments
you either have to specify none of them or all of them
thats annoying
so this method is just either impossible or too verbose
is there any other way i can do a AddPrefab<Player>(PlayerPrefabArgs)
this doesnt work either
i really dont wanna do AddPrefab<Player, PlayerPrefabArgs>(new PlayerPrefabArgs) every time
why not?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.