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)) {