summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 =