Permalink
Browse files

Make value classes TreeCheckers friendly

 - allow for re-typechecking by disabling "redefinition of
   equals" errors for synthetic methods.
  • Loading branch information...
1 parent 6f72ed8 commit 05ad68203a2a54973f77e8dc03757a3d0812182c @retronym retronym committed Jan 20, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1452,7 +1452,7 @@ trait Typers extends Modes with Adaptations with Tags {
case DefDef(_, name, _, _, _, rhs) =>
if (stat.symbol.isAuxiliaryConstructor)
notAllowed("secondary constructor")
- else if (isValueClass && (name == nme.equals_ || name == nme.hashCode_))
+ else if (isValueClass && (name == nme.equals_ || name == nme.hashCode_) && !stat.symbol.isSynthetic)
notAllowed(s"redefinition of $name method. See SIP-15, criterion 4.")
else if (stat.symbol != null && stat.symbol.isParamAccessor)
notAllowed("additional parameter")

0 comments on commit 05ad682

Please sign in to comment.