Independently gate call & local op coeffects, untie from experimental
Summary:
Presently, when a file contains file attribute
<<file: __EnableUnstableFeatures('coeffects_provisional')>>
the parser does not bail out when a context annotation syntax is parsed.
**Previously**, the typechecker read the same file-level attributes
to determine whether to do checks (and extra logic that is not free!)
associated with coeffects -- both calling conventions and local operations.
This is problematic for the rollout of coeffects, namely our first targeted
use case of reactivity/purity because it ties the parser-enabled logic with
typechecker logic that shouldn't be used in WWW before it's extensively tested.
Specifically, we can't have both coeffect annotations (syntax) but fall back
to some old pre-coeffects checks (when require ad-hoc patch due to a bug).
**As of this revision**, the above mechanism no longer *implicitly* sets
`GlobalOptions.*coeffects` but the following flags are added:
- `--call-coeffects` - to enforce calling conventions
- `--local-coeffects` - to enforce local operations (non-calls)
In typechecker tests under subdirectory `coeffect/`, enable those via `HH_FLAGS`.
This change enables tests under `reactive/` to test *both* the old and new
(coeffect-based) checks for reactivity **without losing coverage** for rx/pure;
see the new `typecheck_coeffects` target, which runs tests with the 2 new flags
and requires adding new expected files only when they differ from `.exp` files.
Reviewed By: DavidSnider
Differential Revision:
D25457558
fbshipit-source-id:
7ccbc37feac96d50b258ad8d999e281c5f9fa394