@@ -4,7 +4,7 @@ use chalk_ir::{
44 cast:: Cast ,
55 fold:: { shift:: Shift , Fold , Folder , SuperFold } ,
66 interner:: Interner ,
7- AliasEq , AliasTy , Binders , BoundVar , DebruijnIndex , Fallible , Goal , GoalData , Goals ,
7+ AliasEq , AliasTy , Binders , BoundVar , DebruijnIndex , EqGoal , Fallible , Goal , GoalData , Goals ,
88 ProgramClause , ProgramClauseData , ProgramClauseImplication , QuantifierKind , Ty , TyData , TyKind ,
99 VariableKind , VariableKinds ,
1010} ;
@@ -62,8 +62,19 @@ impl<'i, I: Interner> Folder<'i, I> for SynEqFolder<'i, I> {
6262 self . binders_len += 1 ;
6363 Ok ( new_ty)
6464 }
65- TyData :: Function ( _) => Ok ( ty. clone ( ) ) ,
66- _ => Ok ( ty. super_fold_with ( self , outer_binder) ?) ,
65+ TyData :: Function ( _) => {
66+ self . new_params . push ( VariableKind :: Ty ( TyKind :: General ) ) ;
67+ self . new_goals . push (
68+ EqGoal {
69+ a : new_ty. clone ( ) . cast ( interner) ,
70+ b : ty. clone ( ) . cast ( interner) ,
71+ }
72+ . cast ( interner) ,
73+ ) ;
74+ self . binders_len += 1 ;
75+ Ok ( new_ty)
76+ }
77+ _ => ty. super_fold_with ( self , outer_binder) ,
6778 }
6879 }
6980
0 commit comments