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

[3.0.0-M3] Curried type function not working as expected #10867

Closed
jpablo opened this issue Dec 20, 2020 · 0 comments
Closed

[3.0.0-M3] Curried type function not working as expected #10867

jpablo opened this issue Dec 20, 2020 · 0 comments

Comments

@jpablo
Copy link

jpablo commented Dec 20, 2020

Minimized code

type inserts[a, as <: Tuple] <: Tuple =
  as match
    case EmptyTuple => (a *: EmptyTuple) *: EmptyTuple
    case y *: ys => (a *: y *: ys) *: Tuple.Map[inserts[a, ys], [t <: Tuple] =>> y *: t]

type inserts2[a] =  
  [as <: Tuple] =>> inserts[a, as]

type A = inserts [1, EmptyTuple]
type B = inserts2[1][EmptyTuple]

summon[A =:= ((1 *: EmptyTuple) *: EmptyTuple)]
summon[B =:= ((1 *: EmptyTuple) *: EmptyTuple)]
summon[A =:= B]

type H[t <: Tuple] = Tuple.Concat[t, EmptyTuple]

summon[H[A] =:= H[B]]

// error!
summon[Tuple.Concat[A, EmptyTuple] =:= Tuple.Concat[B, EmptyTuple]]

Output

// Cannot prove that ((1 : Int) *: EmptyTuple) *: EmptyTuple =:= Tuple.Concat[B, EmptyTuple]

Expectation

The snippet should compile.

(it compiles in 3.0.0-M2 but not in 3.0.0-M3)

@OlivierBlanvillain OlivierBlanvillain self-assigned this Dec 21, 2020
odersky added a commit that referenced this issue Sep 22, 2021
Fix #10867: Normalize after applyIfParameterized in superType
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

2 participants