On 4/22/2010 6:15 AM, Runar Jordahl wrote:
> I came across this error in my code:
>
> mySetter: aNumber
> number := number
>
> As you can see, the argument (aNumber) is not used. Instead the
> instance variable (number) is set to itself.
>
> Is there any way to detect the assignment of one variable to itself? A
> Lint rule or rewrite rule (just the query) would be great to have.
You can use this rewrite rule:
`var := `var
If you want a lint rule, you can add:
ParseTreeLintRule class>>variableAssignedToItself
^self
createParseTreeRule: #('`var := `var')
name: 'Variable assigned to itself'
John Brant
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc