Fixes tests

This commit is contained in:
Deukhoofd 2018-11-28 21:28:01 +01:00
parent af0ff235e1
commit c1f4c8fb37
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
2 changed files with 17 additions and 2 deletions

View File

@ -277,8 +277,11 @@ namespace Upsilon.Binder
{ {
var fullStopIndexExpression = (BoundFullStopIndexExpression) expression; var fullStopIndexExpression = (BoundFullStopIndexExpression) expression;
var indexerExpression = fullStopIndexExpression.Expression; var indexerExpression = fullStopIndexExpression.Expression;
var indexerVariable = (TableVariableSymbol)ResolveVariable(indexerExpression); var indexerVariable = ResolveVariable(indexerExpression);
return indexerVariable.Variables[fullStopIndexExpression.Index]; if (indexerVariable.Type == Type.Table)
{
return ((TableVariableSymbol)indexerVariable).Variables[fullStopIndexExpression.Index];
}
} }
return null; return null;
} }

View File

@ -63,4 +63,16 @@ namespace Upsilon.Binder
Variables = variables; Variables = variables;
} }
} }
public class UserDataVariableSymbol : VariableSymbol
{
public BoundTypeDefinition BoundTypeDefinition { get; }
public UserDataVariableSymbol(string name, bool local, BoundTypeDefinition boundTypeDefinition)
:base (name, Type.UserData, local)
{
BoundTypeDefinition = boundTypeDefinition;
}
}
} }