Parameters and ReturnType types will work fine IFFn is a concrete
type. If Fn is not concrete (passed in as a type parameter), the Parameters
and ReturnType could not be properly inferred.
For example, the following code failed to inferred the type of the variable x
Remarks
The following are note for the implementation.
Parameters
andReturnType
types will work fine IFFn
is a concrete type. IfFn
is not concrete (passed in as a type parameter), theParameters
andReturnType
could not be properly inferred.For example, the following code failed to inferred the type of the variable x
Even though we know then signature of
A['a']
, we actually does not know the signature ofC['a']
. Considered the following type:B
is totally a valid subtype of A, and can even be used with the function k. We can concluded that ReturnType is not concrete enough.Using infer, we can get both parameters type and the return type, as they come in pair.
Parameters
andReturnType
, on the other hand, are not.