user-documentation
user-documentation copied to clipboard
Shapes::idx examples are all not typechecked, some invalid
Please complete the information below:
Where is the problem?
The entire example.
What is the problem?
The typechecker doesn't look at pseudomains, and all the code is in pseudomains; a lot of these examples are not legal Hack code.
Please don't change anything below this point.
- Build ID: 2016-08-15T18:49:04+0000:e756f9162e96b867a06b2805e03056a63fc17931:2b940b7ef772640b5980b78c645f89cbd216d81f
- Page requested: /hack/reference/class/HH.Shapes/idx/
- Page requested at: Sun, 02 Oct 2016 03:47:00 +0000
- Controller: APIMethodPageController
They're now in a pseudomain, but this is still invalid and should raise a type error:
+ // The key 'z' doesn't exist in $point so our explicit default 0 is returned
-var_dump(Shapes::idx($point, 'z', 0)); + var_dump(Shapes::idx($point, 'z', 0));
Though I guess that's partially a dupe of #375, the change commit you made for this issue should cause test failures