Hack calls methods members
HHVM Version
f0f3a9e0002edd52415205a46a1e77d808f297df Tue Feb 28 09:10:12 2017
Standalone code, or other way to reproduce the problem
<?hh // strict
abstract class Foo {
abstract public function baz(int $number): void;
}
final class Bar extends Foo {
public function baz(): void {}
}
Expected result
An error about the method baz in Bar having the wrong number of arguments
Actual result
Hack calls baz a member instead.
test.php:7:13,15: Class Bar does not correctly implement all required methods (Typing[4040])
test.php:7:25,27: Some methods are incompatible with those declared in type Foo
Read the following to see why:
test.php:8:19,21: Member baz has the wrong type
test.php:8:19,21: Too few arguments
test.php:4:28,30: Because of this definition
Is this wrong? It correctly says "Too few arguments". And using the term member function isn't that much off either.
Is the issue with the wording of Member baz has the wrong type vs Method baz has the wrong type?
I think this is the intended wording.
Yes, the problem is with the word Member. Member tends to refer to properties, not methods. PHP also calls functions inside a class methods, so there shouldn't be a reason for Hack to diverge in terminology.
I think this is intentional. The term "member function" is a synonym for "method". The word "member" could refer to either member functions, or member variables. In this case it was referring to a member function.
If you submit a PR I would try to get it by hack team members, but I don't see too much value in the change given the error is already pretty clear.