-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
backlogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.itype:language enhancement
Description
minimized code
class Named[S <: String with Singleton](s: S)
object Named {
given Conversion[(s: String), Named[s.type]] {
def apply(s: String): Named[s.type] = new Named(s)
}
// this is ok:
// implicit def convert(s: String): Named[s.type] = new Named[s.type](s)
"abc": Named["abc"]
}
expectation
Expected being able to define an instance of Conversion
equivalent to implicit def convert(s: String): Named[s.type]
. However the definition above fails to parse!
[error] example.scala:22:20: an identifier expected, but '(' found
[error] given Conversion[(s: String), Named[s.type]] {
[error] ^
[error] example.scala:28:3: Found: String("abc")
[error] Required: Named[String("abc")]
[error] "abc": Named["abc"]
[error] ^
[error] two errors found
hrhino and ashwinbhaskar
Metadata
Metadata
Assignees
Labels
backlogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.itype:language enhancement