summaryrefslogtreecommitdiff
path: root/test/files/run/t10261/Test_2.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2017-04-12 09:16:08 -0700
committerGitHub <noreply@github.com>2017-04-12 09:16:08 -0700
commit21d12e9f5ec1ffe023f509848911476c1552d06f (patch)
tree1f18742955bbdc6914c23c739e65f11a738895a3 /test/files/run/t10261/Test_2.scala
parent12c240d69b6958d2c8f03a7728c097dd215011cd (diff)
parent747e22322330a762dd54037ccc1cb3608c6691bd (diff)
downloadscala-21d12e9f5ec1ffe023f509848911476c1552d06f.tar.gz
scala-21d12e9f5ec1ffe023f509848911476c1552d06f.tar.bz2
scala-21d12e9f5ec1ffe023f509848911476c1552d06f.zip
Merge pull request #5845 from adriaanm/t10261
Actually retract clashing synthetic apply/unapply
Diffstat (limited to 'test/files/run/t10261/Test_2.scala')
-rw-r--r--test/files/run/t10261/Test_2.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/t10261/Test_2.scala b/test/files/run/t10261/Test_2.scala
new file mode 100644
index 0000000000..d7d9fe9a0e
--- /dev/null
+++ b/test/files/run/t10261/Test_2.scala
@@ -0,0 +1,14 @@
+import scala.util.Try
+
+object C extends Companion[C] {
+ def parse(v: String) = if (v.nonEmpty) Some(new C(v)) else None
+}
+
+case class C(value: String)
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ assert(Try{C("")}.isFailure, "Empty value should fail to parse") // check that parse is used to validate input
+ assert(C("a").value == "a", "Unexpected value")
+ }
+}