pub struct TyProgram {
pub kind: TyProgramKind,
pub root: TyModule,
pub declarations: Vec<TyDeclaration>,
pub configurables: Vec<TyConstantDeclaration>,
pub storage_slots: Vec<StorageSlot>,
pub logged_types: Vec<(LogId, TypeId)>,
pub messages_types: Vec<(MessageId, TypeId)>,
}
Fields§
§kind: TyProgramKind
§root: TyModule
§declarations: Vec<TyDeclaration>
§configurables: Vec<TyConstantDeclaration>
§storage_slots: Vec<StorageSlot>
§logged_types: Vec<(LogId, TypeId)>
§messages_types: Vec<(MessageId, TypeId)>
Implementations§
source§impl TyProgram
impl TyProgram
sourcepub fn validate_root(
engines: Engines<'_>,
root: &TyModule,
kind: TreeType,
module_span: Span
) -> CompileResult<(TyProgramKind, Vec<TyDeclaration>, Vec<TyConstantDeclaration>)>
pub fn validate_root(
engines: Engines<'_>,
root: &TyModule,
kind: TreeType,
module_span: Span
) -> CompileResult<(TyProgramKind, Vec<TyDeclaration>, Vec<TyConstantDeclaration>)>
Validate the root module given the expected program kind.
sourcepub fn test_fns<'a: 'b, 'b>(
&'b self,
decl_engine: &'a DeclEngine
) -> impl '_ + Iterator<Item = (TyFunctionDeclaration, DeclId)>
pub fn test_fns<'a: 'b, 'b>(
&'b self,
decl_engine: &'a DeclEngine
) -> impl '_ + Iterator<Item = (TyFunctionDeclaration, DeclId)>
All test function declarations within the program.
source§impl TyProgram
impl TyProgram
sourcepub fn type_check(
engines: Engines<'_>,
parsed: &ParseProgram,
initial_namespace: Module
) -> CompileResult<Self>
pub fn type_check(
engines: Engines<'_>,
parsed: &ParseProgram,
initial_namespace: Module
) -> CompileResult<Self>
Type-check the given parsed program to produce a typed program.
The given initial_namespace
acts as an initial state for each module within this program.
It should contain a submodule for each library package dependency.