@@ -6,6 +6,7 @@ import libretto.lambda.Lambdas.Error.LinearityViolation
66import libretto .lambda .util .{Applicative , BiInjective , Exists , Injective , Masked , TypeEq , UniqueTypeArg }
77import libretto .lambda .util .TypeEq .Refl
88import scala .annotation .{tailrec , targetName }
9+ import scala .annotation .nowarn
910
1011class LambdasImpl [-⚬ [_, _], |*| [_, _], V ](using
1112 ssc : SymmetricSemigroupalCategory [-⚬ , |*| ],
@@ -631,6 +632,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
631632 override def cap2_gcd_this [T , Y ](that : CaptureSnd [T , Y ])(using ev : (Var [A1 ] |*| Var [A2 ]) =:= Var [T ]): Option [Tail [Var [T ], Var [T |*| Y ] |*| Var [A1 |*| A2 ]]] =
632633 varIsNotPair(ev.flip)
633634
635+ @ nowarn(" msg=match may not be exhaustive" )
634636 override def asZip [P1 , P2 ](using
635637 ev : (Var [A1 ] |*| Var [A2 ]) =:= (P1 |*| P2 ),
636638 ): Exists [[V1 ] =>> Exists [[V2 ] =>> (Zip [V1 , V2 ], P1 =:= Var [V1 ], P2 =:= Var [V2 ], Var [A1 |*| A2 ] =:= Var [V1 |*| V2 ])]] =
@@ -702,6 +704,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
702704 case (None , Some (_)) =>
703705 bug(s " Variable ${that.resultVar} appeared as a result of two different projections " )
704706
707+ @ nowarn(" msg=match may not be exhaustive" )
705708 override def unzip_gcd_this [T1 , T2 ](that : Unzip [T1 , T2 ])(using
706709 ev : Var [A1 |*| A2 ] =:= Var [T1 |*| T2 ],
707710 ): Option [Tail [Var [T1 |*| T2 ], (Var [T1 ] |*| Var [T2 ]) |*| Var [A1 ]]] =
@@ -855,6 +858,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
855858 override def unzip_gcd_this [T1 , T2 ](that : Unzip [T1 , T2 ])(using ev : Var [A ] =:= Var [T1 |*| T2 ]): Option [Tail [Var [T1 |*| T2 ], (Var [T1 ] |*| Var [T2 ]) |*| Var [X |*| A ]]] =
856859 UnhandledCase .raise(s " ${this .getClass.getSimpleName}.unzip_gcd_this " )
857860
861+ @ nowarn(" msg=match may not be exhaustive" )
858862 override def cap1_gcd_this [T , Y ](that : CaptureFst [T , Y ])(using ev : Var [A ] =:= Var [T ]): Option [Tail [Var [T ], Var [Y |*| T ] |*| Var [X |*| A ]]] =
859863 ev match { case Injective [Var ](TypeEq (Refl ())) =>
860864 (that.resultVar testEqual this .resultVar) map {
@@ -889,6 +893,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
889893 override def cap1_gcd_this [T , Y ](that : CaptureFst [T , Y ])(using Var [A ] =:= Var [T ]): Option [Tail [Var [T ], Var [Y |*| T ] |*| Var [A |*| X ]]] =
890894 None
891895
896+ @ nowarn(" msg=match may not be exhaustive" )
892897 override def cap2_gcd_this [T , Y ](that : CaptureSnd [T , Y ])(using ev : Var [A ] =:= Var [T ]): Option [Tail [Var [T ], Var [T |*| Y ] |*| Var [A |*| X ]]] =
893898 ev match { case Injective [Var ](TypeEq (Refl ())) =>
894899 (that.resultVar testEqual this .resultVar) map {
@@ -935,6 +940,8 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
935940 }
936941 }
937942
943+ @ nowarn(" msg=match may not be exhaustive" )
944+ @ nowarn(" msg=type test" )
938945 def gcd [C [_], D [_], X , Y , Z ](
939946 f : Op .Affine [C [Var [X ]], Y ],
940947 g : Op .Affine [D [Var [X ]], Z ],
@@ -964,6 +971,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
964971 }
965972 }
966973
974+ @ nowarn(" msg=match may not be exhaustive" )
967975 private def gcdZips [A1 , A2 , B1 , B2 ](
968976 z1 : Zip [A1 , A2 ],
969977 z2 : Zip [B1 , B2 ],
@@ -1070,6 +1078,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
10701078 case Op .Prj2 (_, _) => None
10711079 }
10721080
1081+ @ nowarn(" msg=match may not be exhaustive" )
10731082 def pullBumpDupVar [A , F [_], V , C [_], B , D [_], Y ](
10741083 pre : Tail [A , F [Var [V ]]],
10751084 post : Tail [F [C [Var [V ]]], B ],
@@ -1211,6 +1220,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
12111220 }
12121221 object Unvar {
12131222 case class SingleVar [V ]() extends Unvar [Var [V ], V ] {
1223+ @ nowarn(" msg=match may not be exhaustive" )
12141224 override def uniqueOutType [C ](that : Unvar [Var [V ], C ]): V =:= C =
12151225 that.maskInput.visit([VV ] => (that : Unvar [VV , C ], ev : VV =:= Var [V ]) => {
12161226 that match {
@@ -1225,6 +1235,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
12251235 }
12261236
12271237 case class Par [A1 , A2 , X1 , X2 ](u1 : Unvar [A1 , X1 ], u2 : Unvar [A2 , X2 ]) extends Unvar [A1 |*| A2 , X1 |*| X2 ] {
1238+ @ nowarn(" msg=match may not be exhaustive" )
12281239 override def uniqueOutType [C ](that : Unvar [A1 |*| A2 , C ]): (X1 |*| X2 ) =:= C =
12291240 that.maskInput.visit([A ] => (that : Unvar [A , C ], ev : A =:= (A1 |*| A2 )) => {
12301241 that match {
@@ -1248,6 +1259,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
12481259 override def pair [A1 , A2 , X1 , X2 ](f1 : Unvar [A1 , X1 ], f2 : Unvar [A2 , X2 ]): Unvar [A1 |*| A2 , X1 |*| X2 ] =
12491260 Unvar .Par (f1, f2)
12501261
1262+ @ nowarn(" msg=match may not be exhaustive" )
12511263 override def unpair [A1 , A2 , X ](f : Unvar [A1 |*| A2 , X ]): Unpaired [A1 , A2 , X ] =
12521264 f.maskInput.visit[Unpaired [A1 , A2 , X ]]([A ] => (u : Unvar [A , X ], ev : A =:= (A1 |*| A2 )) => {
12531265 u match {
@@ -1266,6 +1278,7 @@ class LambdasImpl[-⚬[_, _], |*|[_, _], V](using
12661278 [V , A , B ] => (ev : Var [V ] =:= (A |*| B )) => throw new AssertionError (" Var[A] =:= (A |*| B)" )
12671279
12681280 extension[F [_], V , U ](ev : F [Var [V ]] =:= (Var [U ] |*| Var [U ])) {
1281+ @ nowarn(" msg=match may not be exhaustive" )
12691282 def deriveEquality (f : Focus [|*| , F ]): V =:= U =
12701283 f match {
12711284 case f : Focus .Fst [pair, f1, q] =>
0 commit comments