Don't try and type check function parameters if they're not bound

This commit is contained in:
Deukhoofd 2019-01-23 18:22:56 +01:00
parent d641ab936f
commit 493a8ebb9d
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 3 additions and 3 deletions

View File

@ -250,11 +250,11 @@ namespace Upsilon.BoundTypes
if (functionParameter.Type.Type.HasFlag(Type.UserData)) if (functionParameter.Type.Type.HasFlag(Type.UserData))
{ {
var variable = Binder.Binder.ResolveVariable(callingParameter, null); var variable = Binder.Binder.ResolveVariable(callingParameter, null) as UserDataVariableSymbol;
var parent =
(UserDataBoundTypeDefinition) variable?.BoundTypeDefinition;
if (variable != null && variable.TypeContainer == Type.UserData) if (variable != null && variable.TypeContainer == Type.UserData)
{ {
var parent =
(UserDataBoundTypeDefinition) ((UserDataVariableSymbol) variable).BoundTypeDefinition;
if (parent.ValidInternalTypes.Length != 0) if (parent.ValidInternalTypes.Length != 0)
{ {
if (functionParameter.ActualType != null) if (functionParameter.ActualType != null)