Hi, On 16/03/16 16:36, Phil Sturgeon wrote:
2. This whole temporary nullability situation, where unset properties will error on attempted usage if not set. Should they instead error after the constructor has been called if they are still not holding a value?
I'd have the error at the time of attempted use, if only because it's easier for people trying to introduce typing to existing code. I'd support borrowing the "?" nullable annotation from HackLang for people who want a less strict behavior: public ?string $name; This means that $name can either be a string or the NULL value. It could be argued that this encourages bad practices (using NULL to represent errors, for example) but I think the benefits in providing easier adoption outweigh the negatives. Massive thumbs up from me on typed properties. Might be worth looking at Hack's implementation as they're already doing this. - Matt.