This repository was archived by the owner on Jun 5, 2023. It is now read-only.

Description
Currently, this code does not immediately compile:
type Structural = {
def foo: Int
}
inline def bar[T <: Structural](t: T) = t.foo
The error given is
Found: (t : T)
Required: Selectable
where: T is a type in method bar with bounds <: Structural
The following import might fix the problem:
import reflect.Selectable.reflectiveSelectable
Scastie that includes the import.
However, I don't think there isn't any need for reflection here, since bar is inlined and the actual type of t will be known at the call site. Would it be possible to expand t.foo to just a normal method call instead of using reflection? I don't think it's a major change, but if it is, it would still be nice to have in a future version of Scala.