summaryrefslogtreecommitdiff
path: root/test/files/neg/userdefined_apply.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-02-28 14:14:11 -0800
committerAdriaan Moors <adriaan@lightbend.com>2017-04-06 08:00:13 -0700
commit31a56077af5c5b35049fec456204e12a19bb6701 (patch)
treeb1e40f24fc34d87e117d2e7a0fdcccdeb4dc254c /test/files/neg/userdefined_apply.scala
parent276434b4af2c2d244d1b5e596867041b36e7b920 (diff)
downloadscala-31a56077af5c5b35049fec456204e12a19bb6701.tar.gz
scala-31a56077af5c5b35049fec456204e12a19bb6701.tar.bz2
scala-31a56077af5c5b35049fec456204e12a19bb6701.zip
Improvements based on reviews by Lukas & Jason
Diffstat (limited to 'test/files/neg/userdefined_apply.scala')
-rw-r--r--test/files/neg/userdefined_apply.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/neg/userdefined_apply.scala b/test/files/neg/userdefined_apply.scala
index 1f2aff6e82..0a0d960b39 100644
--- a/test/files/neg/userdefined_apply.scala
+++ b/test/files/neg/userdefined_apply.scala
@@ -8,6 +8,8 @@ object ClashOverloadNoSig {
case class ClashOverloadNoSig private(x: Int)
object ClashRecNoSig {
+ // TODO: status quo is that the error refers to an overloaded method, which is actually recursive
+ // (we should have unlinked the symbol in the `if(suppress)` part of `applyUnapplyMethodCompleter`)
// error: recursive method apply needs result type
private def apply(x: Int) = if (x > 0) ClashRecNoSig(1) else ???
}
@@ -29,3 +31,27 @@ object NoClashOverload {
}
case class NoClashOverload private(x: Int)
+
+
+class BaseNCNSP[T] {
+ // TODO: suppress the following error
+ // error: NoClashNoSigPoly.type does not take parameters
+ def apply(x: T) = if (???) NoClashNoSigPoly(1) else ???
+}
+
+object NoClashNoSigPoly extends BaseNCNSP[Boolean]
+// TODO: position error at definition of apply in superclass instead of on case clss
+// error: recursive method apply needs result type
+case class NoClashNoSigPoly private(x: Int)
+
+
+class BaseCNSP[T] {
+ // TODO: suppress the following error
+ // error: ClashNoSigPoly.type does not take parameters
+ def apply(x: T) = if (???) ClashNoSigPoly(1) else ???
+}
+
+object ClashNoSigPoly extends BaseCNSP[Int]
+// TODO: position error at definition of apply in superclass instead of on case clss
+// error: recursive method apply needs result type
+case class ClashNoSigPoly private(x: Int)