-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathi16018-orig.scala
More file actions
39 lines (33 loc) · 1.33 KB
/
i16018-orig.scala
File metadata and controls
39 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// The original akka-minimized reproduction from #16018 (verbatim, modulo
// `_` → `?` syntax migration). Posted by @He-Pin on 2022-09-17:
//
// https://github.com/scala/scala3/issues/16018#issuecomment-1250066489
//
// Pre-fix this rejected with
//
// Found: (other : ?1.CAP)
// Required: Main.Source[T, M] & ?1.CAP
// where: ?1 is an unknown value of type
// scala.runtime.TypeBox[Nothing, Main.Graph[Main.SourceShape[T], ? <: M]]
//
// The directional minimizations of this same shape live in
// tests/pos/i16018b.scala (the matrix); this file pins the exact
// reproduction so that the original ticket cannot regress in either
// direction.
import scala.collection.immutable
object Main:
class Source[+Out, +Mat] extends Graph[SourceShape[Out], Mat]
class Shape
class SourceShape[+T] extends Shape
class Graph[+S <: Shape, +M]
def combine[T, U, M](sources: java.util.List[? <: Graph[SourceShape[T], ? <: M]])
: Source[U, java.util.List[M]] =
val seq: immutable.Seq[Graph[SourceShape[T], M]] =
if sources != null then
immutableSeq(sources).collect {
case source: Source[T, M] @unchecked => source
case other => other
}
else immutable.Seq()
???
def immutableSeq[T](iterable: java.lang.Iterable[T]): immutable.Seq[T] = ???