Fix index error on userdata

This commit is contained in:
Deukhoofd 2018-11-27 17:40:13 +01:00
parent 16e1cde5c6
commit 160ed60cc2
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 10 additions and 2 deletions

View File

@ -251,8 +251,16 @@ namespace Upsilon.Binder
{ {
if (assignment.Type == Type.Table) if (assignment.Type == Type.Table)
{ {
var tableExpression = (BoundTableExpression) assignment; if (assignment.Kind == BoundKind.BoundTableExpression)
variable = new TableVariableSymbol(name, isLocal, tableExpression.Expressions); {
variable = new TableVariableSymbol(name, isLocal, ((BoundTableExpression)assignment).Expressions);
}
else if (assignment.Kind == BoundKind.VariableExpression)
{
variable = new TableVariableSymbol(name, isLocal,
((TableVariableSymbol) ((BoundVariableExpression) assignment).Variable.VariableSymbol)
.Variables);
}
} }
else else
{ {