Handle binding of function parameter better, consider inheritance
This commit is contained in:
parent
73a0d64bed
commit
d121bb2409
|
@ -2,7 +2,7 @@ using System;
|
|||
|
||||
namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Interface)]
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Interface, Inherited = false)]
|
||||
public class UpsilonUserDataAttribute : Attribute
|
||||
{
|
||||
public UpsilonUserDataAttribute(string name)
|
||||
|
|
|
@ -46,9 +46,19 @@ namespace Upsilon.Binder.VariableSymbols
|
|||
var userData = functionParameter.TypeContainer.UserData;
|
||||
if (string.IsNullOrEmpty(userData))
|
||||
continue;
|
||||
|
||||
if (!string.Equals(userData,
|
||||
callingParameter.ValueType.UserData))
|
||||
{
|
||||
var boundFunctionType = BoundTypeHandler.GetTypeDefinition(userData).ValidInternalTypes.FirstOrDefault();
|
||||
var boundCallingType =
|
||||
BoundTypeHandler.GetTypeDefinition(callingParameter.ValueType.UserData);
|
||||
|
||||
if (boundCallingType.ValidInternalTypes.Contains(boundFunctionType))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
isValid = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue