File tree 1 file changed +14
-12
lines changed
sway-core/src/semantic_analysis 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -1183,20 +1183,22 @@ impl<'a> TypeCheckContext<'a> {
1183
1183
type_engine. insert ( self . engines , TypeInfo :: ErrorRecovery ( err) , None )
1184
1184
} ) ;
1185
1185
1186
- // grab the module where the type itself is declared
1187
- let type_module = self . namespace ( ) . lookup_submodule_from_absolute_path (
1188
- handler,
1189
- self . engines ( ) ,
1190
- item_prefix,
1191
- ) ?;
1186
+ let mut items = local_items;
1187
+ if item_prefix != self . namespace ( ) . mod_path {
1188
+ // grab the module where the type itself is declared
1189
+ let type_module = self . namespace ( ) . lookup_submodule_from_absolute_path (
1190
+ handler,
1191
+ self . engines ( ) ,
1192
+ item_prefix,
1193
+ ) ?;
1192
1194
1193
- // grab the items from where the type is declared
1194
- let mut type_items = type_module
1195
- . current_items ( )
1196
- . get_items_for_type ( self . engines , type_id) ;
1195
+ // grab the items from where the type is declared
1196
+ let mut type_items = type_module
1197
+ . current_items ( )
1198
+ . get_items_for_type ( self . engines , type_id) ;
1197
1199
1198
- let mut items = local_items ;
1199
- items . append ( & mut type_items ) ;
1200
+ items . append ( & mut type_items ) ;
1201
+ }
1200
1202
1201
1203
let mut matching_item_decl_refs: Vec < ty:: TyTraitItem > = vec ! [ ] ;
1202
1204
You can’t perform that action at this time.
0 commit comments