Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rcano opened this issue Sep 24, 2020 · 1 comment
Closed

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

rcano opened this issue Sep 24, 2020 · 1 comment

Comments

@rcano
Copy link

rcano commented Sep 24, 2020

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.

@tpolecat
Copy link

tpolecat commented Nov 4, 2020

This seems to be the root of a lot of problems I'm seeing as well. Arity abstraction doesn't really work without this equivalence.

@tpolecat tpolecat mentioned this issue Nov 6, 2020
8 tasks
OlivierBlanvillain added a commit to dotty-staging/dotty that referenced this issue Nov 26, 2020
OlivierBlanvillain added a commit to dotty-staging/dotty that referenced this issue Nov 30, 2020
OlivierBlanvillain added a commit to dotty-staging/dotty that referenced this issue Mar 31, 2021
bishabosha added a commit that referenced this issue Mar 31, 2021
Fix #9871: use toNestedPairs in provablyDisjoint
michelou pushed a commit to michelou/dotty that referenced this issue Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants