Type parameters on override function?

hey there,

I have a Type Parameters problem on function who is override on a subclass.

an example is better than words :

This case is possible ?

I don’t find any information on :

thx

You don’t need to create method specific type params for methods just to use the class’s type parameter

function createAndAddState<T : U>(stateClass : Class<T>)

can just be

function createAndAddState(stateClass : Class<U>)

and

function createAndAddState<T:MyState>(stateClass : Class<T>)

can just be

function createAndAddState(stateClass : Class<MyState>)

and it should work: Try Haxe !

1 Like