Or carry the information externally, as per the type information. That the semantic check method is defined on the AST class (and thus has access to update this var) was due to laziness - not because it's the right place for it. The AST node should be agnostic to how many passes a semantic check runs over it, or the state they have when they do.