Skip to content

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

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
FlorianCassayre opened this issue Apr 5, 2022 · 0 comments · Fixed by #14861

Comments

@FlorianCassayre
Copy link
Contributor

FlorianCassayre commented Apr 5, 2022

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.

@FlorianCassayre FlorianCassayre added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 5, 2022
@smarter smarter added area:incremental-compilation area:export and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 5, 2022
@odersky odersky self-assigned this Apr 6, 2022
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 6, 2022
TreeUnpickler assumed that a type was an abstract type if its RHS was a TypeBounds tree.
But TypeBounds trees also encode alias types, so this needs to be refined.

Fixes scala#14858
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 6, 2022
TreeUnpickler assumed that a type was an abstract type if its RHS was a TypeBounds tree.
But TypeBounds trees also encode alias types, so this needs to be refined.

Fixes scala#14858
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 25, 2022
TreeUnpickler assumed that a type was an abstract type if its RHS was a TypeBounds tree.
But TypeBounds trees also encode alias types, so this needs to be refined.

Fixes scala#14858
@Kordyjan Kordyjan added this to the 3.2.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants