Skip to content

Kind polymorphic type cannot must take parameters #6083

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

Closed
nicolasstucki opened this issue Mar 12, 2019 · 1 comment
Closed

Kind polymorphic type cannot must take parameters #6083

nicolasstucki opened this issue Mar 12, 2019 · 1 comment

Comments

@nicolasstucki
Copy link
Contributor

Given that we can write

type K0[T] = T
val a: K0[Int] = 1

type K1[T[_]] = T
val b: K1[List][Int] = Nil

We could try abstract this type over kind with

type K[T <: AnyKind] = T
val a: K[Int] = 1
val b: K[List][Int] = Nil

Though this one currently fails with

-- [E056] Syntax Error ----------------------------
9 |  val a: K[Int] = 1
  |         ^^^^^^
  |         Missing type parameter for Test.K[Int]
-- [E056] Syntax Error ---------------------------
12 |  val b: K[List][Int] = Nil
   |         ^^^^^^^^^^^^
   |         Missing type parameter for Test.K[List][Int]

There is a potential usecase in #6082 for the internal encoding of quoted.Type splices.

@nicolasstucki
Copy link
Contributor Author

@odersky @milessabin is this pattern supposed to be supported by kind polymorphism?

@odersky odersky self-assigned this Mar 17, 2019
smarter added a commit that referenced this issue Mar 20, 2019
Fix #6083: Dealias before kind checking
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