Closed
Description
minimized code
type Tr[+V, +O <: V]
def (tr: Tr[V, O]) sl[V, O <: V]: Tr[V, O] = ???
def as[V, O <: V](tr: Tr[V, O]) : Tr[V, O] = tr.sl
An error is found by the compiler whine none is expected
-- [E007] Type Mismatch Error: ABug.scala:5:45 ---------------------------------
5 |def as[V, O <: V] (tr: Tr[V, O]): Tr[V, O] = tr.sl
| ^^
| Found: queries.Tr[V, V]
| Required: queries.Tr[V, O]
|
| where: O is a type in method as with bounds <: V
| V is a type in method as with bounds >: O
|
| Constraint(
| uninstVars = ;
| constrained types =
| bounds =
| ordering =
| )
| Subtype trace:
For information, the issue disappears if I replace nullary method by parameterless