File tree 1 file changed +10
-8
lines changed
sway-core/src/semantic_analysis 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -743,16 +743,18 @@ impl<'a> TypeCheckContext<'a> {
743
743
)
744
744
. unwrap_or_else ( |err| type_engine. id_of_error_recovery ( err) ) ;
745
745
746
- // grab the module where the type itself is declared
747
- let type_module = self
748
- . namespace ( )
749
- . require_module_from_absolute_path ( handler, & item_prefix. to_vec ( ) ) ?;
746
+ let mut items = local_items;
747
+ if item_prefix. to_vec ( ) != self . namespace ( ) . current_mod_path {
748
+ // grab the module where the type itself is declared
749
+ let type_module = self
750
+ . namespace ( )
751
+ . require_module_from_absolute_path ( handler, & item_prefix. to_vec ( ) ) ?;
750
752
751
- // grab the items from where the type is declared
752
- let mut type_items = type_module. get_items_for_type ( self . engines , type_id) ;
753
+ // grab the items from where the type is declared
754
+ let mut type_items = type_module. get_items_for_type ( self . engines , type_id) ;
753
755
754
- let mut items = local_items ;
755
- items . append ( & mut type_items ) ;
756
+ items . append ( & mut type_items ) ;
757
+ }
756
758
757
759
let mut matching_item_decl_refs: Vec < ty:: TyTraitItem > = vec ! [ ] ;
758
760
You can’t perform that action at this time.
0 commit comments