Struct cairo_lang_semantic::resolve::Resolver
source · pub struct Resolver<'db> {
pub module_file_id: ModuleFileId,
pub resolved_items: ResolvedItems,
pub inference: Inference<'db>,
/* private fields */
}
Expand description
Resolves paths semantically.
Fields§
§module_file_id: ModuleFileId
§resolved_items: ResolvedItems
§inference: Inference<'db>
Implementations§
source§impl<'db> Resolver<'db>
impl<'db> Resolver<'db>
pub fn new(db: &'db dyn SemanticGroup, module_file_id: ModuleFileId) -> Self
sourcepub fn add_generic_param(&mut self, generic_param: GenericParam)
pub fn add_generic_param(&mut self, generic_param: GenericParam)
Adds a generic param to an existing resolver. This is required since a resolver needs to exist before resolving the generic params, and thus, they are added to the Resolver only after they are resolved.
sourcepub fn resolve_concrete_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
path: &ExprPath,
item_type: NotFoundItemType
) -> Maybe<ResolvedConcreteItem>
pub fn resolve_concrete_path( &mut self, diagnostics: &mut SemanticDiagnostics, path: &ExprPath, item_type: NotFoundItemType ) -> Maybe<ResolvedConcreteItem>
Resolves a concrete item, given a path. Guaranteed to result in at most one diagnostic.
sourcepub fn resolve_generic_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
path: &ExprPath,
item_type: NotFoundItemType
) -> Maybe<ResolvedGenericItem>
pub fn resolve_generic_path( &mut self, diagnostics: &mut SemanticDiagnostics, path: &ExprPath, item_type: NotFoundItemType ) -> Maybe<ResolvedGenericItem>
Resolves a generic item, given a path. Guaranteed to result in at most one diagnostic.
sourcepub fn specialize_function(
&mut self,
diagnostics: &mut SemanticDiagnostics,
stable_ptr: SyntaxStablePtrId,
generic_function: GenericFunctionId,
generic_args: Vec<GenericArg>
) -> Maybe<FunctionId>
pub fn specialize_function( &mut self, diagnostics: &mut SemanticDiagnostics, stable_ptr: SyntaxStablePtrId, generic_function: GenericFunctionId, generic_args: Vec<GenericArg> ) -> Maybe<FunctionId>
Specializes a generic function.
sourcepub fn specialize_type(
&mut self,
diagnostics: &mut SemanticDiagnostics,
stable_ptr: SyntaxStablePtrId,
generic_type: GenericTypeId,
generic_args: Vec<GenericArg>
) -> Maybe<TypeId>
pub fn specialize_type( &mut self, diagnostics: &mut SemanticDiagnostics, stable_ptr: SyntaxStablePtrId, generic_type: GenericTypeId, generic_args: Vec<GenericArg> ) -> Maybe<TypeId>
Specializes a generic type.