-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Compiler version
3.0.0-RC3
Minimized code
object OK {
def apply(n: Int ): Unit = ()
def apply(n: Long): Unit = ()
apply(3) // ok
apply(3L) // ok
}
object KO {
type Key = Int
def apply(n: Key ): Unit = ()
def apply(n: Long): Unit = ()
apply(3) // error
apply(3L) // ok
}
Output
[error] 12 | apply(3) // error
[error] | ^^^^^
[error] |Ambiguous overload. The overloaded alternatives of method apply in object KO with types
[error] | (n: Long): Unit
[error] | (n: KO.Key): Unit
[error] |both match arguments ((3 : Int))
[error] one error found
Expectation
Success. This works with Scala 2.x.