Skip to content

Export foo.given ignores implicit members #18605

Open
@bishabosha

Description

@bishabosha

Compiler version

3.3.0

Minimized code

//> using option -Xprint:typer

import java.time.LocalDate
import mymath.given

object mymath:
  export math.Ordered.given

def before(d1: LocalDate, d2: LocalDate): Boolean = d1 < d2 // error

Output

-- [E008] Not Found Error: -----------------------------------------------------
6 |def before(d1: LocalDate, d2: LocalDate): Boolean = d1 < d2 // error
  |                                                    ^^^^
  |value < is not a member of java.time.LocalDate, but could be made available as an extension method.
  |
  |One of the following imports might fix the problem:
  |
  |  import math.Ordered.orderingToOrdered
  |  import math.Ordering.Implicits.infixOrderingOps
  |
1 error found

Expectation

I would expect that at least orderingToOrdered would be exported, e.g.

final lazy module val mymath: mymath = new mymath()
final module class mymath() extends Object() { this: mymath.type =>
  export math.Ordered.given
  ...
  final implicit def orderingToOrdered[T](x: T)(implicit ord: Ordering[T]):
    Ordered[T] = math.Ordered.orderingToOrdered[T](x)(ord)
}

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