summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2006-11-17 10:24:28 +0000
committermihaylov <mihaylov@epfl.ch>2006-11-17 10:24:28 +0000
commitaecb355ecc0477f1a126e316a52e0288488307c8 (patch)
treec545cc8e807ed245843cbf91426c6d7ab095ac90
parent837661837e2bdc4605e34617296267f2eba80208 (diff)
downloadscala-aecb355ecc0477f1a126e316a52e0288488307c8.tar.gz
scala-aecb355ecc0477f1a126e316a52e0288488307c8.tar.bz2
scala-aecb355ecc0477f1a126e316a52e0288488307c8.zip
Include self-test in the synthetic equals metho...
Include self-test in the synthetic equals method for case classes
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 6a54b005f2..bdb02e2803 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -102,12 +102,20 @@ trait SyntheticMethods requires Analyzer {
typed(DefDef(method, vparamss =>
Apply(
Select(
- TypeApply(
- Select(Ident(vparamss.head.head), Any_isInstanceOf),
- List(TypeTree(clazz.tpe))),
- Boolean_and),
+ Apply(
+ Select(Ident(vparamss.head.head), Object_eq),
+ List(This(clazz))),
+ Boolean_or),
List(
- Apply(gen.mkAttributedRef(target), This(clazz) :: (vparamss.head map Ident))))));
+ Apply(
+ Select(
+ TypeApply(
+ Select(Ident(vparamss.head.head), Any_isInstanceOf),
+ List(TypeTree(clazz.tpe))),
+ Boolean_and),
+ List(
+ Apply(gen.mkAttributedRef(target),
+ This(clazz) :: (vparamss.head map Ident))))))));
}
def isSerializable(clazz: Symbol): Boolean =