Skip to content

Tuple.Map and upper bounds #12645

Closed
@Adam-Vandervorst

Description

@Adam-Vandervorst

Compiler version

3.0.0-RC3

Minimized code

case class TBox[A <: Tuple](v: A)

@main def m =
    val t: TBox[EmptyTuple] = TBox(EmptyTuple) // works
    val tt: Tuple.Map[(EmptyTuple, EmptyTuple), TBox] = (TBox(EmptyTuple), TBox(EmptyTuple))

Output

Type argument TBox does not conform to upper bound [_$4] =>> Any
    val tt: Tuple.Map[(EmptyTuple, EmptyTuple), TBox] = (TBox(EmptyTuple), TBox(EmptyTuple))

Expectation

Since the first line of the main function and the snippet below work, I expected the above to work too.

case class ABox[A](v: A)

@main def main_f = {
    val a: ABox[Int] = ABox(1)
    val ta: Tuple.Map[(Int, Int), ABox] = (ABox(1), ABox(2))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions