This avoids accidentally resolving things to a declarations which is not
visible to the reference.
void VariableResolver::apply(Stage &s)
{
stage = &s;
+ s.types.clear();
+ s.interface_blocks.clear();
Stage *builtin_stage = get_builtins(s.type);
builtins = (builtin_stage ? &builtin_stage->content : 0);
s.content.visit(*this);
void FunctionResolver::apply(Stage &s)
{
stage = &s;
+ s.functions.clear();
s.content.visit(*this);
}