We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4868b8d commit 3e6d1bcCopy full SHA for 3e6d1bc
tests/pos/i23611.scala
@@ -0,0 +1,26 @@
1
+import java.io.{File, IOException}
2
+import java.net.URI
3
+import java.nio.file.{Path, Paths}
4
+import scala.reflect.ClassTag
5
+
6
+trait FileConnectors {
7
+ def listPath(path: => Path): ZStream[Any, IOException, Path]
8
9
+ final def listFile(file: => File): ZStream[Any, IOException, File] =
10
+ for {
11
+ path <- null.asInstanceOf[ZStream[Any, IOException, Path]]
12
+ r <- listPath(path).mapZIO(a => ZIO.attempt(a.toFile).refineToOrDie)
13
+ } yield r
14
+}
15
16
+sealed trait ZIO[-R, +E, +A]
17
+extension [R, E <: Throwable, A](self: ZIO[R, E, A])
18
+ def refineToOrDie[E1 <: E: ClassTag]: ZIO[R, E1, A] = ???
19
20
+object ZIO:
21
+ def attempt[A](code: => A): ZIO[Any, Throwable, A] = ???
22
23
+sealed trait ZStream[-R, +E, +A]:
24
+ def map[B](f: A => B): ZStream[R, E, B] = ???
25
+ def flatMap[R1 <: R, E1 >: E, B](f: A => ZStream[R1, E1, B]): ZStream[R1, E1, B]
26
+ def mapZIO[R1 <: R, E1 >: E, A1](f: A => ZIO[R1, E1, A1]): ZStream[R1, E1, A1]
0 commit comments