Ignore fixmes when doing Errors.try_
commitb25d2baf07807c8abea154bf524e2a01a8e302e1
authorMatt Schellhas <rms@fb.com>
Mon, 18 Nov 2019 23:10:03 +0000 (18 15:10 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 18 Nov 2019 23:12:10 +0000 (18 15:12 -0800)
tree599f841e1736e256c3a590f09de9255ba5c831c2
parent667f4cc60a584236e62959b45a15d0f4edd5ada6
Ignore fixmes when doing Errors.try_

Summary:
`Errors.try_` and its kin cause subtle (and non-subtle) problems everywhere they are used. This fixes one subtle problem where fixmes could be applied to an error, but since it was in a `try_` we never actually recorded its application. Since saved state was unaware of the fixme application, it didn't think it needed to re-typecheck dependent files even though the fixme hid an error there. So when the fixme was removed, hack wouldn't notice the now-unhidden error.

The fix is to ignore fixme applications while in a `try_`. If we're discarding the error anyways, people shouldn't be able to fixme them. And since we can't apply fixmes, we don't need to juggle saved state. This also has the added benefit of moving a few errors closer to the expression that causes them, as well as eliminating some bad behavior where a fixme could impact errors in another file.

Reviewed By: vassilmladenov

Differential Revision: D18336759

fbshipit-source-id: 796c604fc5b5d92405332efebdfe725a03827be4
hphp/hack/src/errors/errors.ml
hphp/hack/test/dynamic_view/reason_err_messages.php.exp
hphp/hack/test/typecheck/class_level_where_clauses/this_as/parent_construct.php
hphp/hack/test/typecheck/fixme_cascade.php.exp
hphp/hack/test/typecheck/new_inference/eager_solve/my_array_map_then_invoke_curried.php.exp