Skip to content
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

local implies yielding #3532

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dkalinichenko-js
Copy link
Contributor

Make yielding mode the default if local is set. The change is only limited to syntax parsing and does not change the inference code. To preserve consistency, the global modality/modifier now also implies unyielding by default, and [@local_opt] also varies along the yielding axis.

Subsequent PRs will add yielding annotations to the Capsule API and to the Effects API.

The printer now displays stack_ allocation return values with @ unyielding, as intended.

This change sometimes causes principal and non-principal type inference to diverge when the old syntax for local_ annotations is used. I'm surprised this compiler option affects syntax parsing, but the issue seems benign.

@@ -176,7 +176,7 @@ let disallowed_by_regionality (local_ unique_ r) x =
Line 3, characters 16-17:
3 | let ref = ref r in
^
Error: This value escapes its region.
Error: This value is "yielding" but expected to be "unyielding".
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message got worse. I'm not sure what to do about it, since the axis on which we fail submoding is produced by the mode solver.

@dkalinichenko-js dkalinichenko-js force-pushed the dkalinichenko/local-implies-yielding branch from 0a38111 to 00ad634 Compare February 6, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants