Skip to content

Both tuple syntax are not the same to the compiler #9871

Closed
@rcano

Description

@rcano

Minimized code

  type IsTypeInTuple[T, Tup <: Tuple] = Tup match {
    case EmptyTuple => false
    case T *: ts => true
    case _ *: ts => IsTypeInTuple[T, ts]
  }
  summon[(Int *: String *: EmptyTuple) =:= (Int, String)] //they are the same
  summon[IsTypeInTuple[String, Int *: String *: EmptyTuple] =:= true] //compiles
  summon[IsTypeInTuple[String, (Int, String)] =:= true] //doesn't compile
  summon[IsTypeInTuple[String, Tuple.Widen[Int *: String *: EmptyTuple]] =:= true] // doesn't compiles

Expectation

the last two summon should compile, just like the other cases.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions