Properly detect invalid assignment LHS at compile time.

This commit is contained in:
Stephen Chung
2020-03-07 17:32:15 +08:00
parent a8be700b9f
commit d055638e83
4 changed files with 90 additions and 59 deletions

View File

@@ -116,7 +116,7 @@ impl Error for ParseError {
ParseErrorType::FnMissingName => "Expecting name in function declaration",
ParseErrorType::FnMissingParams(_) => "Expecting parameters in function declaration",
ParseErrorType::WrongFnDefinition => "Function definitions must be at top level and cannot be inside a block or another function",
ParseErrorType::AssignmentToInvalidLHS => "Assignment to an unsupported left-hand side expression"
ParseErrorType::AssignmentToInvalidLHS => "Cannot assign to this expression because it will only be changing a copy of the value"
}
}