Restructure the HIR to use indices for nested declarations #44
Labels
A-name-resolution
Area: Name resolution
A-type-system
Area: Type system
T-enhancement
Type: Enhancement
Instead of having
hir::Declaration
s insidehir::{Module, Data}
, useHIRIndex
/HIRIdentifier
and store all declarations linearly inCrateScope
. This would make iterating over declarations easier. We can and should then also store the parent for each declaration.This would get rid of our
Index
/Environment
"hack" in the typer (and resolver(?)) we currently require in some cases for handling constructors and need some data from the parent data declaration — in the new system, we can simply look up the parent byHIRIndex
(plus some "downcasting"). Maybe this would also allow us to throw out thetyper::Registration
system by just having a list of those indices. I don't know.This might also help finding unused declarations, implementing privacy and printing relative paths but maybe it does not but only if we also do this change to
lowered_ast::Declaration
b.c. the resolver needs it. I dunno.The text was updated successfully, but these errors were encountered: