@@ -87,9 +87,9 @@ pub(super) fn trivial<'a, DB: HirDatabase>(
8787 } )
8888}
8989
90- /// # Type constructor tactic
90+ /// # Data constructor tactic
9191///
92- /// Attempts different type constructors for enums and structs in scope
92+ /// Attempts different data constructors for enums and structs in scope
9393///
9494/// Updates lookup by new types reached and returns iterator that yields
9595/// elements that unify with `goal`.
@@ -99,7 +99,7 @@ pub(super) fn trivial<'a, DB: HirDatabase>(
9999/// * `defs` - Set of items in scope at term search target location
100100/// * `lookup` - Lookup table for types
101101/// * `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 > (
103103 ctx : & ' a TermSearchCtx < ' a , DB > ,
104104 defs : & ' a FxHashSet < ScopeDef > ,
105105 lookup : & ' a mut LookupTable ,
@@ -308,7 +308,9 @@ pub(super) fn type_constructor<'a, DB: HirDatabase>(
308308 // Early exit if some param cannot be filled from lookup
309309 let param_exprs: Vec < Vec < Expr > > = fields
310310 . 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+ } )
312314 . collect :: < Option < _ > > ( ) ?;
313315
314316 // Note that we need special case for 0 param constructors because of multi cartesian
0 commit comments