Struct cairo_lang_semantic::resolve_path::Resolver
source · pub struct Resolver<'db> {
pub module_file_id: ModuleFileId,
pub lookback: ResolvedLookback,
/* private fields */
}
Expand description
Resolves paths semantically.
Fields§
§module_file_id: ModuleFileId
§lookback: ResolvedLookback
Implementations§
source§impl<'db> Resolver<'db>
impl<'db> Resolver<'db>
pub fn new(
db: &'db dyn SemanticGroup,
module_file_id: ModuleFileId,
generic_params: &[GenericParamId]
) -> Self
sourcepub fn resolve_concrete_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
path: &ExprPath,
item_type: NotFoundItemType
) -> Maybe<ResolvedConcreteItem>
pub fn resolve_concrete_path(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
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_segment(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
segment: &PathSegment
) -> Maybe<(TerminalIdentifier, Option<Vec<GenericArgumentId>>)>
pub fn resolve_segment(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
segment: &PathSegment
) -> Maybe<(TerminalIdentifier, Option<Vec<GenericArgumentId>>)>
Resolves a path segment’s identifier and generic args.
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 resolve_trait(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
concrete_trait_function_id: ConcreteTraitGenericFunctionId,
stable_ptr: SyntaxStablePtrId
) -> Maybe<ConcreteImplId>
pub fn resolve_trait(
&mut self,
diagnostics: &mut SemanticDiagnostics,
inference: &mut Inference<'_>,
concrete_trait_function_id: ConcreteTraitGenericFunctionId,
stable_ptr: SyntaxStablePtrId
) -> Maybe<ConcreteImplId>
Given a concrete trait (with possible type variables in generic args), resolves it to its implementation.
sourcepub fn impl_lookup_context(&mut self, trait_id: TraitId) -> ImplLookupContext
pub fn impl_lookup_context(&mut self, trait_id: TraitId) -> ImplLookupContext
Retrieve an impl lookup context for finding impls for a trait in the current context.