-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider modalities when adding baggage to with-kinds #3401
base: rae/with-kinds
Are you sure you want to change the base?
Conversation
Parser Change ChecklistThis PR modifies the parser. Please check that the following tests are updated:
This test should have examples of every new bit of syntax you are adding. Feel free to just check the box if your PR does not actually change the syntax (because it is refactoring the parser, say). |
d0f9538
to
7f8173c
Compare
7f8173c
to
a45f29f
Compare
1e1efeb
to
16d4feb
Compare
16e83fa
to
70cf6eb
Compare
6a29bd9
to
65e7ba6
Compare
70cf6eb
to
25eadb9
Compare
65e7ba6
to
74cc04a
Compare
I've just force-pushed to accommodate the force-push to #3284. |
(This should not be merged until #3284 is reviewed, so there's no rush here.) |
737a2a8
to
c01dc5d
Compare
LGTM, I think |
9354afe
to
7da1766
Compare
Thanks for the PR - I think in the long run, in type checker, the baggage will contain a list of types, each with a modality (could be |
yep, that sounds right to me |
7df828b
to
66bd480
Compare
Parse and represent optional modalities on `with` in jkind annotations. This supports jkind annotations like: value mod portable many uncontended with 'a @@ uncontended with int
If a field has a constant modality, or a type is annotated with a constant modality, then skip that type when adding it as baggage to the kind, both when converting user-written kind annotations and inferring kinds on types. The guts of this is a big, ugly pattern match on Jkind_axis and Modes.Modality.Const.axis, which ideally can go away or get much simpler with a refactor to unify these two types, but I decided to do it this way for now to get something working that's known-correct, and refactor under green
This isn't nearly as ugly (in predef) as I expected.
Co-authored-by: Richard Eisenberg <[email protected]>
22fbe6a
to
0ef90f9
Compare
If a field has a constant modality, or a type is annotated with a constant
modality, then skip that type when adding it as baggage to the kind, both when
converting user-written kind annotations and inferring kinds on types.
The guts of this is a big, ugly pattern match on Jkind_axis and
Modes.Modality.Const.axis, which ideally can go away or get much simpler with a
refactor to unify these two types, but I decided to do it this way for now to
get something working that's known-correct, and refactor under green