Fix for exception when userdata method call does not exist
This commit is contained in:
parent
e8369bb672
commit
fa967383d6
|
@ -281,11 +281,14 @@ namespace Upsilon.Binder
|
||||||
}
|
}
|
||||||
else if (resolved is UserDataVariableSymbol udSymbol)
|
else if (resolved is UserDataVariableSymbol udSymbol)
|
||||||
{
|
{
|
||||||
if (udSymbol.Parent != null && udSymbol.Parent.Properties[resolved.Name] is UserDataBoundMethod ubMethod)
|
if (udSymbol.Parent != null )
|
||||||
|
{
|
||||||
|
if (udSymbol.Parent.Properties.TryGetValue(resolved.Name, out var ubProperty) && ubProperty is UserDataBoundMethod ubMethod)
|
||||||
{
|
{
|
||||||
returnType = ubMethod.ResultType;
|
returnType = ubMethod.ResultType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new BoundFunctionCallExpression(expression, parameters.ToImmutable(), e.Span, returnType);
|
return new BoundFunctionCallExpression(expression, parameters.ToImmutable(), e.Span, returnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue