At the moment we have the AST and a corresponding visitor on that AST. The ResolutionVisitor, which ensures all names have been resolved and, more importantly, diagnostics related to names have been emitted early, uses this ast::Visitor. The AST however contains ambiguities, which now shows up for example in SubroutinePort. Resolving names is possible for one variant of the ambiguity (anonymous port with a named type), but not possible for the other (named port with implicit type). The ResolutionVisitor should rather be a rst::Visitor, which goes over the AST with resolved ambiguities.
It's not yet quite clear how to do this. Intuitively one would want to "inherit" from the ast::Visitor and "override" a few of the callbacks (the ones which may walk over ambiguities) in order to resolve them up front before calling corresonding functions for the resolved node. Not sure how to do this in Rust without just re-implementing the whole trait, though.
At the moment we have the AST and a corresponding visitor on that AST. The
ResolutionVisitor
, which ensures all names have been resolved and, more importantly, diagnostics related to names have been emitted early, uses thisast::Visitor
. The AST however contains ambiguities, which now shows up for example inSubroutinePort
. Resolving names is possible for one variant of the ambiguity (anonymous port with a named type), but not possible for the other (named port with implicit type). TheResolutionVisitor
should rather be arst::Visitor
, which goes over the AST with resolved ambiguities.It's not yet quite clear how to do this. Intuitively one would want to "inherit" from the
ast::Visitor
and "override" a few of the callbacks (the ones which may walk over ambiguities) in order to resolve them up front before calling corresonding functions for the resolved node. Not sure how to do this in Rust without just re-implementing the whole trait, though.