Fix parametered functions skipping a token

This commit is contained in:
2019-06-08 16:30:23 +02:00
parent 7ed53193de
commit d385a9e3ee
2 changed files with 18 additions and 12 deletions

View File

@@ -100,6 +100,7 @@ BoundStatement *Binder::BindFunctionDeclarationStatement(ParsedStatement *statem
auto type = make_shared<FunctionScriptType>(returnType, parameterTypes, parameterKeys);
auto assignment = this->_scope->AssignVariable(identifier.GetHash(), type);
if (assignment.GetResult() != VariableAssignmentResult::Ok){
this -> _scriptData -> Diagnostics -> LogError(DiagnosticCode::CantAssignVariable, statement->GetStartPosition(), statement->GetLength());
return new BoundBadStatement();
}
auto boundBlock = this -> BindBlockStatement(functionStatement->GetBlock());