From 9455b753a081f865360fe2c1e79ced690ea78458 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 30 Nov 2018 11:12:10 +0100 Subject: [PATCH] Resolved UserData not binding proper type when multiple index expressions are chained --- Upsilon/Binder/Binder.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Upsilon/Binder/Binder.cs b/Upsilon/Binder/Binder.cs index 3fa205a..81e8fdf 100644 --- a/Upsilon/Binder/Binder.cs +++ b/Upsilon/Binder/Binder.cs @@ -709,11 +709,10 @@ namespace Upsilon.Binder return new BoundFullStopIndexExpression(expression, index, Type.Unknown, e.Span); } - if (expression.Kind == BoundKind.VariableExpression) + var variableSymbol = ResolveVariable(expression); + if (variableSymbol != null) { - var variableExpression = (BoundVariableExpression)expression; - var obj = variableExpression.Variable; - var functionParameter = (FunctionParameterSymbol) obj.VariableSymbol; + var functionParameter = (FunctionParameterSymbol) variableSymbol; var udBoundDef = (UserDataBoundTypeDefinition)functionParameter.BoundTypeDefinition; if (udBoundDef.Properties.TryGetValue(index, out var property)) {