Skip to content

Inlined opaque type not equal to itself #6854

Closed
@nicolasstucki

Description

@nicolasstucki

minimized code

object Test {
  import Lib._
  val xs: IArray2[Int] = IArray2(1)
}

object Lib {
  opaque type IArray2[+T] = Array[_ <: T]

  object IArray2 {
    inline def apply(x: =>Int): IArray2[Int] = Array(x)
  }
}

expectation

Should work but fails with

4 |  val xs: IArray2[Int] = IArray2(1)
  |                         ^^^^^^^^^^
  |                         Found:    Lib.IArray2[Int]
  |                         Required: Lib.IArray2[Int]

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