Created
August 17, 2015 23:49
-
-
Save HRMsimon/5dbe5ad1c1d84e31b3f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ hh_single_type_check test.php | |
File "test.php", line 7, characters 7-7: | |
Class B does not initialize all of its members; name is not always initialized. | |
Make sure you systematically set $this->name when the method __construct is called. | |
Alternatively, you can define the member as optional (?...) | |
(NastCheck[3015]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?hh | |
abstract class A { | |
protected string $name; | |
} | |
class B extends A { | |
protected string $name = 'Hello'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment