Ban the use of $this in static closures
commit0b7291b0de889bed93b2c3a612fbc0837ec4ebcd
authorPaul Bissonnette <paulbiss@fb.com>
Wed, 10 Jul 2019 21:10:31 +0000 (10 14:10 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 10 Jul 2019 21:21:22 +0000 (10 14:21 -0700)
tree9155a00a2f91c49b62b367849749043c41441e43
parentea75ea15033f7a62fbd40adfdbd548cd749707b2
Ban the use of $this in static closures

Summary: An earlier diff which removed support for using `$this` in static methods missed static closures declared within instance methods.

Reviewed By: oulgen

Differential Revision: D16081790

fbshipit-source-id: 250b208dd77bd8dedbdf4fffc7a67aeb08a16cfd
hphp/hack/src/parser/ast_check.ml
hphp/test/quick/closure_static.php
hphp/test/quick/closure_static.php.expectf
hphp/test/slow/bad-this-closure-1.php [new file with mode: 0644]
hphp/test/slow/bad-this-closure-1.php.expectf [new file with mode: 0644]
hphp/test/slow/bad-this-closure-2.php [new file with mode: 0644]
hphp/test/slow/bad-this-closure-2.php.expectf [new file with mode: 0644]
hphp/test/slow/phpism/disable_static_closures.php
hphp/test/zend/good/Zend/tests/closure_005.php
hphp/test/zend/good/Zend/tests/closure_005.php.expectf