Throw error when using meth_caller with non-public methods
Summary:
Currently, Hack does not throw an error if you use `meth_caller` on a public or private method from within the same class hierarchy.
```
class Foo extends MyChild {
protected function bar(): void {}
private function baz(): void {}
public function test(): void {
$y = meth_caller(Foo::class, 'bar');
$z = meth_caller(Foo::class, 'baz');
}
}
```
Currently, using this reference will result in a HHVM runtime error, as we don't support this yet. We will in the future, so make this controllable via an option in both `hh_single_type_check` and `.hhconfig` so that we don't need another release to change this in the future.
`hh_single_type_check --meth_caller_only_public_visibility=false $t`
and the
`meth_caller_only_public_visibility = false`
option in `.hhconfig` will stop Hack from throwing these errors.
Reviewed By: periodic1236
Differential Revision:
D28136384
fbshipit-source-id:
4aa9d8cc085c51a22ad92776d3a787c7e715d941