-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Compiler version
3.0.2-RC1-bin-SNAPSHOT
Minimized code
import Tuple.Union
type Channel = "orders" | "trades"
def getChannelList[Channels <: NonEmptyTuple](c: Channels)(using Union[Channels] <:< Channel) =
val channels: List[Channel] = c.toList
channels
Expectation
Compiles fine
Output
fails to compile with error:
[error] 6 | val channels: List[Channel] = c.toList
[error] | ^^^^^^^^
[error] |Found: List[Tuple.Union[(c : Channels)]]
[error] |Required: List[Channel]
[error] |
[error] |where: Channels is a type in method getChannelList with bounds <: NonEmptyTuple
[error] |
[error] |
[error] |Note: a match type could not be fully reduced:
[error] |
[error] | trying to reduce Tuple.Union[(c : Channels)]
[error] | trying to reduce scala.Tuple.Fold[(c : Channels), Nothing, [x, y] =>> x | y]
[error] | failed since selector (c : Channels)
[error] | matches none of the cases
[error] |
[error] | case EmptyTuple => Nothing
[error] | case h *: t => h | scala.Tuple.Fold[t, Nothing, [x, y] =>> x | y]