Skip to content

Commit 3e6d1bc

Browse files
committed
Add test case
1 parent 4868b8d commit 3e6d1bc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/pos/i23611.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)