Show better error position if table assignment statement is a bad statement
This commit is contained in:
parent
e5f08d5859
commit
a413c5ecd4
|
@ -911,7 +911,8 @@ namespace Upsilon.Binder
|
|||
{
|
||||
BoundExpression indexableExpression;
|
||||
var value = BindExpression(e.Expression);
|
||||
|
||||
if (e.TableExpression.Kind == SyntaxKind.BadExpression)
|
||||
return new BoundExpressionStatement(new BoundBadExpression(e.Span), e.Span);
|
||||
|
||||
if (e.TableExpression.Kind == SyntaxKind.IndexExpression)
|
||||
{
|
||||
|
@ -936,9 +937,10 @@ namespace Upsilon.Binder
|
|||
}
|
||||
else
|
||||
{
|
||||
var indexable =
|
||||
(BoundFullStopIndexExpression) BindFullStopIndexExpression(
|
||||
var indexableExp = BindFullStopIndexExpression(
|
||||
(FullStopIndexExpressionSyntax) e.TableExpression, true);
|
||||
if (!(indexableExp is BoundFullStopIndexExpression indexable))
|
||||
return new BoundExpressionStatement(new BoundBadExpression(e.Span), e.Span);
|
||||
|
||||
if (indexable.Expression.Kind == BoundKind.VariableExpression)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue