-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:implicitsrelated to implicitsrelated to implicitsarea:implicits:implicitConversionIssues tied with scala.language.implicitConversionsIssues tied with scala.language.implicitConversionsitype:bug
Description
Compiler version
3.7.2
Minimized code
//> using scala 3.7.2
object Foo
object Wrap extends Selectable:
type Fields = (foo: Int)
def selectDynamic(name: String): Any = 42
given Conversion[Foo.type, Wrap.type]:
def apply(v: Foo.type): Wrap.type = Wrap
import scala.language.implicitConversions
println(Foo.foo) // compiler error value foo is not a member of object Foo
Output
compiler error value foo is not a member of object Foo
Expectation
No compiler error.
Notes
The problem is that type Selectable { type Fields = (foo: Int) }
is not a subtype of refinement ?{ foo: <?> }
.
So, when given conversion is checking as a candidate, method ProtoTypes.Compatibility#isCompatible
returns false
.
What about to make Selectable { type Fields = (foo: Int) }
subtype of ?{ foo: <?> }
?
Metadata
Metadata
Assignees
Labels
area:implicitsrelated to implicitsrelated to implicitsarea:implicits:implicitConversionIssues tied with scala.language.implicitConversionsIssues tied with scala.language.implicitConversionsitype:bug