Closed
Description
Compiler version
3.2.2
Minimized example
class Ann(x: Any) extends annotation.Annotation
object Message:
implicit def toNoExplanation(str: String): Message @Ann(str) = ???
class Message
object report:
def error(x: Message): Unit = ???
def test =
report.error("a") // works
report.error("a".stripMargin) // error
Output
10 | report.error("a".stripMargin)
| ^^^^^^^^^^^^^^^
| Found: String
| Required: Message
|
Expectation
Should compile. The problem needs the following elements:
- the expected conversion needs to be a dependent method
- the argument needs to involve another implicit conversion in some way (in this case, the wrapper to
StringLike
which containsstripMargin
.