Skip to content

Wrong type mismatch of HKT under separate compilation #3422

Closed
@OlivierBlanvillain

Description

@OlivierBlanvillain

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]
  |

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions