Skip to content

Instantly share code, notes, and snippets.

@HRMsimon
Created August 17, 2015 23:49
Show Gist options
  • Save HRMsimon/5dbe5ad1c1d84e31b3f4 to your computer and use it in GitHub Desktop.
Save HRMsimon/5dbe5ad1c1d84e31b3f4 to your computer and use it in GitHub Desktop.
$ 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])
<?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