hhvm / hhast

Mutable AST library for Hack with linting and code migrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DontReturnFromCloneLinter

lexidor opened this issue · comments

For rationale, see facebook/hhvm#3757.

Returning a value from __clone() is always a mistake, since the return value is never used. __clone is called on the newly created object before resolving a clone $obj expression.

Checking the return type of the method ought to be enough. No need to actually check the body for returns.