Simple Errors beyond Syntax
Some kinds or errors we can check using straightforward checks:
- a class member is overloaded (forbidden in Tool, requires override keyword in Scala):
- a method is overloaded (forbidden in Tool, requires override keyword in Scala):
To make it efficient and clean to check for such errors, we associate mapping from each identifier to the symbol that the identifier represents.
We use Map data structures to maintain this mapping.
The rules that specify how declarations are used to construct such maps are given by scope rules of the programming language.