Handle generic inheritance for checking if type is valid for function parameter
This commit is contained in:
parent
a413c5ecd4
commit
cd6384614b
|
@ -56,7 +56,14 @@ namespace Upsilon.BaseTypes.ScriptFunction
|
|||
{
|
||||
var validSymbol =
|
||||
parameterSymbol.BoundTypeDefinition.ValidInternalTypes.Any(validType =>
|
||||
validType.IsAssignableFrom(parameterType));
|
||||
{
|
||||
var b = validType.IsAssignableFrom(parameterType);
|
||||
if (b) return true;
|
||||
if (parameterType.IsGenericType &&
|
||||
validType.IsAssignableFrom(parameterType.GetGenericTypeDefinition()))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
if (!validSymbol)
|
||||
{
|
||||
isCompatible = false;
|
||||
|
|
Loading…
Reference in New Issue