Closed
Description
Compiler version
3.2.1
Minimized code
enum Tag[A]:
case MyTuple extends Tag[(String, String)]
def printIt[A](t: Tag[A], a: A): Unit =
t match
case Tag.MyTuple => println(a._1)
Output
value _1 is not a member of A
where: A is a type in method printIt with bounds >: (String, String) and <: (String, String)
Expectation
Should compile fine, since the compiler knows that it is <: (String, String)
and (String, String)
should have _1
. FWIW, annotating the type works. I.e.
case Tag.MyTuple => println((a: (String, String))._1)
compiles fine.