Fix binding functions when no access to direct types

This commit is contained in:
Deukhoofd 2019-01-21 15:09:43 +01:00
parent 30c3223cb4
commit 97f3a4d879
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 11 additions and 4 deletions

View File

@ -23,7 +23,7 @@ namespace Upsilon.BoundTypes
} }
public UserDataBoundTypeDefinition(string name, Dictionary<string, UserDataBoundProperty> backingType) public UserDataBoundTypeDefinition(string name, Dictionary<string, UserDataBoundProperty> backingType)
: base(new TypeContainer(name), typeof(void)) : base(new TypeContainer(name), new System.Type[0])
{ {
Name = name; Name = name;
Properties = backingType; Properties = backingType;
@ -216,11 +216,18 @@ namespace Upsilon.BoundTypes
{ {
var parent = var parent =
(UserDataBoundTypeDefinition) ((UserDataVariableSymbol) variable).BoundTypeDefinition; (UserDataBoundTypeDefinition) ((UserDataVariableSymbol) variable).BoundTypeDefinition;
if (parent.ValidInternalTypes.Length != 0)
{
if (functionParameter.ActualType != null && if (functionParameter.ActualType != null &&
!parent.ValidInternalTypes.Any(x => string.Equals(x.Name, functionParameter.ActualType))) !parent.ValidInternalTypes.Any(x => string.Equals(x.Name, functionParameter.ActualType)))
{ {
return false; return false;
} }
if (!string.Equals(parent.Name, functionParameter.ActualType, StringComparison.InvariantCultureIgnoreCase))
{
return false;
}
}
} }
} }
} }