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