File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
tests/shared/src/test/scala-3/cats/mtl/tests Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,18 @@ class Handle3Tests extends munit.FunSuite:
57
57
case Error1 .Second => " second1" .pure[F ]
58
58
case Error1 .Third => " third1" .pure[F ]
59
59
assert.equals(test.value.value.toOption, Some (" third1" ))
60
+
61
+ test(" submerge two independent errors with union(scala 3)" ):
62
+ enum Error1 :
63
+ case First , Second , Third
64
+ enum Error2 :
65
+ case Fourth
66
+ val test =
67
+ allow[Error1 | Error2 ]:
68
+ Error1 .Third .raise[F , String ].as(" nope" )
69
+ .rescue:
70
+ case Error1 .First => " first1" .pure[F ]
71
+ case Error1 .Second => " second1" .pure[F ]
72
+ case Error1 .Third => " third1" .pure[F ]
73
+ case Error2 .Fourth => " fourth1" .pure[F ]
74
+ assert.equals(test.value.value.toOption, Some (" third1" ))
You can’t perform that action at this time.
0 commit comments