You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
# What
We currently hold two flags on the typing environment
1) `env.inside_constructor` - set when we typecheck a constructor, then we call
`method_def` in `typing_class.ml`
2) `env.genv.fun_is_ctor` - set when we call `method_def` in `typing_class.ml`
by inspecting the name of the method and doing some string comparison.
Given that these two fields do the same thing, I'm removing the one from `env`.
# Why
For const props, I'd like to enforce checking writes to a const prop during
function calls, but not when typechecking method defs. I may need to carry
another flag on the typing environment `inside_method_def` or something
similar. Before adding a field, I figured I'd clean up here and pay off my
cost.
Reviewed By: mheiber
Differential Revision: D83250939
fbshipit-source-id: 72a825dd8da6484909ff707c361d1d2d3de46bce
0 commit comments