blob: 1f2aff6e822caf365cddd4f2603de186c30353d3 (
plain) (
tree)
|
|
object ClashOverloadNoSig {
// error: overloaded method apply needs result type
private def apply(x: Int) = if (x > 0) new ClashOverloadNoSig(x) else apply("")
def apply(x: String): ClashOverloadNoSig = ???
}
case class ClashOverloadNoSig private(x: Int)
object ClashRecNoSig {
// error: recursive method apply needs result type
private def apply(x: Int) = if (x > 0) ClashRecNoSig(1) else ???
}
case class ClashRecNoSig private(x: Int)
object NoClashNoSig {
// error: overloaded method apply needs result type
private def apply(x: Boolean) = if (x) NoClashNoSig(1) else ???
}
case class NoClashNoSig private(x: Int)
object NoClashOverload {
// error: overloaded method apply needs result type
private def apply(x: Boolean) = if (x) NoClashOverload(1) else apply("")
def apply(x: String): NoClashOverload = ???
}
case class NoClashOverload private(x: Int)
|