Skip to content

Kind polymorphic type cannot must take parameters #6083

Closed
@nicolasstucki

Description

@nicolasstucki

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions