Skip to content

Commit

Permalink
Make value classes TreeCheckers friendly
Browse files Browse the repository at this point in the history
 - allow for re-typechecking by disabling "redefinition of
   equals" errors for synthetic methods.
  • Loading branch information
retronym committed Jan 26, 2013
1 parent 6f72ed8 commit 05ad682
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Typers.scala
Expand Up @@ -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")
Expand Down

0 comments on commit 05ad682

Please sign in to comment.