@@ -87,9 +87,9 @@ pub(super) fn trivial<'a, DB: HirDatabase>(
87
87
} )
88
88
}
89
89
90
- /// # Type constructor tactic
90
+ /// # Data constructor tactic
91
91
///
92
- /// Attempts different type constructors for enums and structs in scope
92
+ /// Attempts different data constructors for enums and structs in scope
93
93
///
94
94
/// Updates lookup by new types reached and returns iterator that yields
95
95
/// elements that unify with `goal`.
@@ -99,7 +99,7 @@ pub(super) fn trivial<'a, DB: HirDatabase>(
99
99
/// * `defs` - Set of items in scope at term search target location
100
100
/// * `lookup` - Lookup table for types
101
101
/// * `should_continue` - Function that indicates when to stop iterating
102
- pub ( super ) fn type_constructor < ' a , DB : HirDatabase > (
102
+ pub ( super ) fn data_constructor < ' a , DB : HirDatabase > (
103
103
ctx : & ' a TermSearchCtx < ' a , DB > ,
104
104
defs : & ' a FxHashSet < ScopeDef > ,
105
105
lookup : & ' a mut LookupTable ,
@@ -308,7 +308,9 @@ pub(super) fn type_constructor<'a, DB: HirDatabase>(
308
308
// Early exit if some param cannot be filled from lookup
309
309
let param_exprs: Vec < Vec < Expr > > = fields
310
310
. into_iter ( )
311
- . map ( |field| lookup. find ( db, & field. ty ( db) ) )
311
+ . map ( |field| {
312
+ lookup. find ( db, & field. ty_with_args ( db, generics. iter ( ) . cloned ( ) ) )
313
+ } )
312
314
. collect :: < Option < _ > > ( ) ?;
313
315
314
316
// Note that we need special case for 0 param constructors because of multi cartesian
0 commit comments