-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label
Description
similar to #14699
The following works in 2.13, but fails in Scala 3.
Compiler version
3.1.2
Minimized code
import scala.language.implicitConversions
trait StringShouldWrapperForVerb {
def should(right: String): Unit = ???
def should(right: => Unit): Unit = ???
}
object Example {
implicit def convertToStringShouldWrapperForVerb(o: String): StringShouldWrapperForVerb = ???
//ERROR
"test 1" should {
}
//OK
"test 2" should {
()
}
val s: StringShouldWrapperForVerb = ???
s should {
()
}
s should {
}
}
Scala 3 scastie
Scala 2 scastie
Output
None of the overloaded alternatives of method should in trait StringShouldWrapperForVerb with types
(right: => Unit): Unit
(right: String): Unit
match arguments (<nonsensical><notype></nonsensical>)
Expectation
No error, same as in Scala 2.13?
Metadata
Metadata
Assignees
Labels
itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" labelEvery issue needs to have an "area" and "itype" label