File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -691,7 +691,14 @@ impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable>
691691 return Ok ( ( ) ) ;
692692 }
693693 let path = Path :: new ( & __name__[ ..] ) ;
694- let import_path = match cfg. input . resolve_path ( path, cfg) {
694+ let resolved = if call. additional_operation ( ) . unwrap ( ) . is_erg_import ( ) {
695+ cfg. input . resolve_real_path ( path, cfg)
696+ } else {
697+ cfg. input
698+ . resolve_decl_path ( path, cfg)
699+ . or_else ( || cfg. input . resolve_real_path ( path, cfg) )
700+ } ;
701+ let import_path = match resolved {
695702 Some ( path) => path,
696703 None if ERG_MODE => {
697704 for _ in 0 ..600 {
Original file line number Diff line number Diff line change @@ -872,6 +872,22 @@ impl Accessor {
872872 }
873873 }
874874
875+ pub fn full_name ( & self ) -> Option < Str > {
876+ match self {
877+ Self :: Ident ( ident) => Some ( ident. inspect ( ) . clone ( ) ) ,
878+ Self :: Attr ( attr) => Some (
879+ format ! (
880+ "{}{}{}" ,
881+ attr. obj. full_name( ) ?,
882+ attr. ident. vis,
883+ attr. ident. inspect( )
884+ )
885+ . into ( ) ,
886+ ) ,
887+ _ => None ,
888+ }
889+ }
890+
875891 pub fn is_const ( & self ) -> bool {
876892 match self {
877893 Self :: Ident ( ident) => ident. is_const ( ) ,
@@ -6099,6 +6115,15 @@ impl Expr {
60996115 pub fn get_name ( & self ) -> Option < & Str > {
61006116 match self {
61016117 Expr :: Accessor ( acc) => acc. name ( ) ,
6118+ Expr :: TypeAscription ( ascription) => ascription. expr . get_name ( ) ,
6119+ _ => None ,
6120+ }
6121+ }
6122+
6123+ pub fn full_name ( & self ) -> Option < Str > {
6124+ match self {
6125+ Expr :: Accessor ( acc) => acc. full_name ( ) ,
6126+ Expr :: TypeAscription ( ascription) => ascription. expr . full_name ( ) ,
61026127 _ => None ,
61036128 }
61046129 }
You can’t perform that action at this time.
0 commit comments