There are several ways to have typed information to AST 1:
- mutable AST (with optional type field later field)
- having a separated typed AST
- generic AST
- relational AST (akin to a relational database or in data oriented design)
Here is various pages describing AST representation in production systems:
- Persistence, façades and Roslyn’s red-green trees | Fabulous adventures in coding
- rust-analyzer/syntax.md
- Swift Syntax and Structured Editing Library
The following articles also provide good information on AST representation