Expand description
High-level intermediate representation (HIR) boundary.
HIR is the first compiler layer whose reference positions are intended to be
truly resolved. The current syntax::phase::Resolved AST is only a
locally normalized syntax tree: it has no UnresolvedRef nodes, but many
module-sensitive references still carry source paths or leaf-only display names.
The HIR boundary is deliberately separate from the syntax AST so the syntax phase can stay path-first and honest, while HIR can require stronger invariants:
- definition sites are owned by canonical
DagIdidentities; - module-level reference sites use
ResolvedNameorResolvedIndexVariant; - lexical references, such as locals and generic parameters, use dedicated lexical IDs instead of module names;
- built-ins use explicit variants or dedicated typed wrappers, not ad-hoc string dispatch;
- no HIR reference field stores a dotted source alias string.
This module defines and lowers the semantic boundary for type expressions, value expressions, and assertion bodies. Module-aware TIR and runtime evaluation consume this HIR slice for declaration/assertion semantics rather than re-resolving source-shaped syntax AST references.
Re-exports§
pub use expr::AssertBody;pub use expr::BuiltinConst;pub use expr::BuiltinFnName;pub use expr::ConstRef;pub use expr::Expr;pub use expr::ExprDependencies;pub use expr::ExprKind;pub use expr::ExprLowerError;pub use expr::ExprLoweringContext;pub use expr::FunctionRef;pub use expr::LocalDef;pub use expr::LocalEnv;pub use expr::LocalId;pub use expr::collect_expr_dependencies;pub use expr::has_ref_outside_unfold;pub use expr::lower_assert_body;pub use expr::lower_assert_body_tolerant;pub use expr::lower_expr;pub use expr::lower_expr_tolerant;pub use lower::GenericParamBinding;pub use lower::GenericScope;pub use lower::HirLowerError;pub use lower::PreludeTypeScope;pub use lower::TypeLoweringContext;pub use lower::lower_generic_params;pub use lower::lower_nat_expr;pub use lower::lower_type_expr;pub use types::BuiltinType;pub use types::DimExpr;pub use types::DimExprItem;pub use types::DimTermRef;pub use types::DimTermTarget;pub use types::GenericParamDef;pub use types::GenericParamId;pub use types::GenericParamOwner;pub use types::IndexRef;pub use types::NatExpr;pub use types::TypeExpr;pub use types::TypeExprKind;