@@ -4,7 +4,7 @@ use chalk_ir::{
4
4
cast:: Cast ,
5
5
fold:: { shift:: Shift , Fold , Folder , SuperFold } ,
6
6
interner:: Interner ,
7
- AliasEq , AliasTy , Binders , BoundVar , DebruijnIndex , Fallible , Goal , GoalData , Goals ,
7
+ AliasEq , AliasTy , Binders , BoundVar , DebruijnIndex , EqGoal , Fallible , Goal , GoalData , Goals ,
8
8
ProgramClause , ProgramClauseData , ProgramClauseImplication , QuantifierKind , Ty , TyData , TyKind ,
9
9
VariableKind , VariableKinds ,
10
10
} ;
@@ -62,8 +62,19 @@ impl<'i, I: Interner> Folder<'i, I> for SynEqFolder<'i, I> {
62
62
self . binders_len += 1 ;
63
63
Ok ( new_ty)
64
64
}
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) ,
67
78
}
68
79
}
69
80
0 commit comments