Skip to content

Wrong type mismatch of HKT under separate compilation #3422

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
OlivierBlanvillain opened this issue Nov 1, 2017 · 0 comments
Closed

Wrong type mismatch of HKT under separate compilation #3422

OlivierBlanvillain opened this issue Nov 1, 2017 · 0 comments

Comments

@OlivierBlanvillain
Copy link
Contributor

a.scala:

trait Fun[L[_]]

object O1 {
  trait N[X]
}

object O2 {
  def bar: Fun[O1.N] = ???
}

b.scala:

object Test {
  def c: Fun[O1.N] = O2.bar
}

Breaks with separate compilation:

$ rm *.class; dotc a.scala; dotc b.scala
-- [E007] Type Mismatch Error: b.scala:2:24 ------------------------------------
2 |  val c: Fun[O1.N] = O2.bar
  |                     ^^^^^^
  |                     found:    Fun[O1.N]
  |                     required: Fun[O1.N]
  |
odersky added a commit that referenced this issue Dec 11, 2017
Fix #3422: Add missing case to TypeComparer
vitorsvieira pushed a commit to vitorsvieira/dotty that referenced this issue Dec 11, 2017
We missed the case where we compare two hk tpes A <: B, where both A and B refer to
classes with type parameters. It seems this case usually does not arise when we compile
from source because A or B or both are eta expanded. But it can arise after unpickling.
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

1 participant