@@ -737,14 +737,37 @@ impl<'a> AnalyzeContext<'a> {
737737 . chain ( self . comparators ( typ) . into_iter ( ) )
738738 }
739739
740- pub fn enum_implicits ( & self , typ : TypeEnt < ' a > ) -> impl Iterator < Item = EntRef < ' a > > {
740+ pub fn enum_implicits (
741+ & self ,
742+ typ : TypeEnt < ' a > ,
743+ matching_op : bool ,
744+ ) -> impl Iterator < Item = EntRef < ' a > > {
741745 [
742746 self . create_to_string ( typ) ,
743747 self . minimum ( typ) ,
744748 self . maximum ( typ) ,
745749 ]
746750 . into_iter ( )
747751 . chain ( self . comparators ( typ) . into_iter ( ) )
752+ . chain (
753+ if matching_op {
754+ Some (
755+ [
756+ self . symmetric_binary ( Operator :: QueEQ , typ) ,
757+ self . symmetric_binary ( Operator :: QueNE , typ) ,
758+ self . symmetric_binary ( Operator :: QueGT , typ) ,
759+ self . symmetric_binary ( Operator :: QueGTE , typ) ,
760+ self . symmetric_binary ( Operator :: QueLT , typ) ,
761+ self . symmetric_binary ( Operator :: QueLTE , typ) ,
762+ ]
763+ . into_iter ( ) ,
764+ )
765+ } else {
766+ None
767+ }
768+ . into_iter ( )
769+ . flatten ( ) ,
770+ )
748771 }
749772
750773 pub fn record_implicits ( & self , typ : TypeEnt < ' a > ) -> impl Iterator < Item = EntRef < ' a > > {
@@ -787,7 +810,11 @@ impl<'a> AnalyzeContext<'a> {
787810 . into_iter ( )
788811 }
789812
790- pub fn array_implicits ( & self , typ : TypeEnt < ' a > ) -> impl Iterator < Item = EntRef < ' a > > {
813+ pub fn array_implicits (
814+ & self ,
815+ typ : TypeEnt < ' a > ,
816+ matching_op : bool ,
817+ ) -> impl Iterator < Item = EntRef < ' a > > {
791818 let Type :: Array { indexes, elem_type, ..} = typ. kind ( ) else {
792819 unreachable ! ( "Must be array type" )
793820 } ;
@@ -833,6 +860,25 @@ impl<'a> AnalyzeContext<'a> {
833860 . into_iter ( )
834861 . flatten ( ) ,
835862 )
863+ . chain (
864+ if matching_op {
865+ Some (
866+ [
867+ self . binary ( Operator :: QueEQ , typ, typ, typ, * elem_type) ,
868+ self . binary ( Operator :: QueNE , typ, typ, typ, * elem_type) ,
869+ self . binary ( Operator :: QueGT , typ, typ, typ, * elem_type) ,
870+ self . binary ( Operator :: QueGTE , typ, typ, typ, * elem_type) ,
871+ self . binary ( Operator :: QueLT , typ, typ, typ, * elem_type) ,
872+ self . binary ( Operator :: QueLTE , typ, typ, typ, * elem_type) ,
873+ ]
874+ . into_iter ( ) ,
875+ )
876+ } else {
877+ None
878+ }
879+ . into_iter ( )
880+ . flatten ( ) ,
881+ )
836882 }
837883
838884 pub fn access_implicits ( & self , typ : TypeEnt < ' a > ) -> impl Iterator < Item = EntRef < ' a > > {
@@ -1112,10 +1158,11 @@ impl<'a> AnalyzeContext<'a> {
11121158 }
11131159 }
11141160
1115- // ?? for bit
1161+ // ?? operator for bit
11161162 {
11171163 let typ = self . bit ( ) ;
11181164 let qq = self . unary ( Operator :: QueQue , typ, self . boolean ( ) ) ;
1165+
11191166 unsafe {
11201167 self . arena . add_implicit ( typ. id ( ) , qq) ;
11211168 } ;
0 commit comments