Closed
Description
The semantic analyzer is kind of confusing. Refactoring and documenting it better could be pretty helpful. A few ideas:
- Document the relationships between the passes better and which things aren't valid during which passes (e.g. subtype checks or joins).
- Rename the passes to more reasonable names. Maybe just use
SemanticAnalyzerPassN
as the names. - Consider moving the semantic analyzer passes to separate files, or at least have them in the order of the passes within the single file. Currently the second pass comes first, which is confusing.
- Don't share
SemanticAnalyzer
objects with other passes. Instead refactor the shared functionality into a separate utility class and share that.