-
Notifications
You must be signed in to change notification settings - Fork 795
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
Allow _
in async use! _
pattern (lift FS1228 restriction)
#18189
base: main
Are you sure you want to change the base?
Conversation
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
This is a change in what does the language allow. I think it should be guarded with a language version, so the tooling could suggest using |
src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
Outdated
Show resolved
Hide resolved
src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
Outdated
Show resolved
Hide resolved
src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
Outdated
Show resolved
Hide resolved
src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
Outdated
Show resolved
Hide resolved
src/Compiler/Checking/Expressions/CheckComputationExpressions.fs
Outdated
Show resolved
Hide resolved
|
||
error (Error(FSComp.SR.tcInvalidUseBangBindingNoAndBangs (), m)) | ||
mkSynCall "Bind" mBind [ rhsExpr; consumeExpr ] ceenv.builderValName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting a call to "Using" somewhere, but cannot find it.
Is it implicit by recursive calling into a different handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I understood the logic was that _
(wild) will need to be Bind
in the same way that ident
(any ident) __
(double underscore). But Im not very familiar with the CE Translation logic.
Tested this to "Using"
and it does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it only does "Bind" and not an "Using", it will lack the CE's implementation of disposal (which can be anything the CE wants to do to cleanup).
@@ -214,6 +214,70 @@ let run r2 r3 = | |||
(Error 3345, Line 18, Col 9, Line 18, Col 13, "use! may not be combined with and!") | |||
] | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do add positive tests which include a run
operation and demonstrate that a resource which is being use! _ =
'd get's cleaned up with a custom .Using
method of the builder.
Description
Fixes #16343
Before
After
Checklist