Skip to content

Incremental compilation type error: unreducible application of higher-kinded type to wildcard arguments #14858

Closed
@FlorianCassayre

Description

@FlorianCassayre

Compiler version

3.2.0-RC1-bin-20220308-29073f1-NIGHTLY

Minimized code

Minimized repository & Actions output

Namely, two files:

src/main/scala/
├─ A.scala
├─ p/
│  ├─ p.scala
// p/p.scala

package p

object M {
  class C[N]()
}

export M.*
// A.scala

import p.*

type NAME = C[?]

Then we perform the following steps:

  1. Compile
  2. In file A.scala, rename NAME to something else
  3. Compile
(above steps as shell commands)
sbt compile
sed -i 's/NAME/NAME2/g' src/main/scala/A.scala
sbt compile

Output

The second compilation fails (step (3)):

-- [E043] Type Error: /home/runner/work/sbt-incremental-compilation-bug/sbt-incremental-compilation-bug/src/main/scala/A.scala:3:13 
3 |type NAME2 = C[?]
  |             ^^^^
  |   unreducible application of higher-kinded type p.C to wildcard arguments
  |
  | longer explanation available when compiling with `-explain`

Expectation

Step (3) should succeed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions