summaryrefslogtreecommitdiff
path: root/test/files/neg/t6534.check
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-11-01 12:08:11 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-11-01 12:08:11 -0700
commit59149579aec4b3d26a4cb849d80535a36b90ad30 (patch)
tree89e66e34d5420edeb480a382e777dd9b78c317a0 /test/files/neg/t6534.check
parentb7d78d2d6e1d970e7ef2c02a3ad42b4356672971 (diff)
parentc3e2a81b38133f2b997e56ccd85d9bea38896a6b (diff)
downloadscala-59149579aec4b3d26a4cb849d80535a36b90ad30.tar.gz
scala-59149579aec4b3d26a4cb849d80535a36b90ad30.tar.bz2
scala-59149579aec4b3d26a4cb849d80535a36b90ad30.zip
Merge pull request #1526 from paulp/value-classes/6534-equals
New take on SI-6534, value classes.
Diffstat (limited to 'test/files/neg/t6534.check')
-rw-r--r--test/files/neg/t6534.check17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/neg/t6534.check b/test/files/neg/t6534.check
new file mode 100644
index 0000000000..52e70cfa8a
--- /dev/null
+++ b/test/files/neg/t6534.check
@@ -0,0 +1,17 @@
+t6534.scala:4: warning: Implementation of equals inherited from trait Foo overridden in class Bippy1 to enforce value class semantics
+class Bippy1(val x: Int) extends AnyVal with Foo { } // warn
+ ^
+t6534.scala:5: warning: Implementation of hashCode inherited from trait Ding overridden in class Bippy2 to enforce value class semantics
+class Bippy2(val x: Int) extends AnyVal with Ding { } // warn
+ ^
+t6534.scala:6: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class
+class Bippy3(val x: Int) extends AnyVal { override def equals(x: Any) = false } // error
+ ^
+t6534.scala:7: error: redefinition of hashCode method. See SIP-15, criterion 4. is not allowed in value class
+class Bippy4(val x: Int) extends AnyVal { override def hashCode = -1 } // error
+ ^
+t6534.scala:9: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class
+case class Bippy6(val x: Int) extends AnyVal { override def productPrefix = "Dingo" ; override def equals(x: Any) = false } // error
+ ^
+two warnings found
+three errors found