Store the inferred role environment in the typechecker monad state#3910
Store the inferred role environment in the typechecker monad state#3910kl0tl wants to merge 1 commit intopurescript:masterfrom
Conversation
|
I'd prefer not to do this if it ends up adding more mutable state (like this new
That is, I'd quite like to do the first at some point (maybe post-0.14.0), but I'm not sure the second is worth doing. |
|
I'm not really that keen on the first refactoring I proposed here now either (see #3881 (comment)) so I think I'm going to close this. I'm sorry for leading you astray! |
This lifts role inference to the typechecker monad so we can store a role environment in
CheckStateinstead of recomputing one each time we infer a binding group roles. This was extracted from #3860 to not delay the merge and discuss separately. See #3860 (comment) for context.I’m happy to be wrong but I’m not sure checked roles, inferred roles and declared roles could all be stored under the types field of the environment because we need to compare declared roles to inferred roles in order to check they’re not more permissive and types are only inserted in the environment once their roles have been checked.