Don't cascade errors if index assignment index is error
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2019-06-15 16:01:34 +02:00
parent 5cd05053e1
commit f73bd2003c
No known key found for this signature in database
GPG Key ID: B4C087AC81641654
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ BoundStatement *Binder::BindIndexAssignmentStatement(const ParsedStatement *stat
auto s = (ParsedIndexAssignmentStatement*) statement;
auto boundIndexExpression = this -> BindIndexExpression((IndexExpression*)s->GetIndexExpression(), true);
auto valueExpression = this -> BindExpression(s->GetValueExpression());
if (boundIndexExpression->GetType()->operator!=(valueExpression->GetType().get())){
auto boundIndexType = boundIndexExpression -> GetType();
if (boundIndexType ->GetClass() != TypeClass ::Error && boundIndexType->operator!=(valueExpression->GetType().get())){
this -> _scriptData -> Diagnostics -> LogError(DiagnosticCode::InvalidTableValueType, statement->GetStartPosition(), statement->GetLength());
return new BoundBadStatement();
}