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;
|
BoundExpression indexableExpression;
|
||||||
var value = BindExpression(e.Expression);
|
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)
|
if (e.TableExpression.Kind == SyntaxKind.IndexExpression)
|
||||||
{
|
{
|
||||||
|
@ -936,9 +937,10 @@ namespace Upsilon.Binder
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var indexable =
|
var indexableExp = BindFullStopIndexExpression(
|
||||||
(BoundFullStopIndexExpression) BindFullStopIndexExpression(
|
|
||||||
(FullStopIndexExpressionSyntax) e.TableExpression, true);
|
(FullStopIndexExpressionSyntax) e.TableExpression, true);
|
||||||
|
if (!(indexableExp is BoundFullStopIndexExpression indexable))
|
||||||
|
return new BoundExpressionStatement(new BoundBadExpression(e.Span), e.Span);
|
||||||
|
|
||||||
if (indexable.Expression.Kind == BoundKind.VariableExpression)
|
if (indexable.Expression.Kind == BoundKind.VariableExpression)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue