Uh oh!
There was an error while loading. Please reload this page.
[FS-1140] add Boolean-returning and return-type-directed partial active patterns - #16473
Conversation
This will need a small RFC, describing the approach and codegen, so we don't lose it, since it's a change to spec. |
|
ijklam
commented
Dec 30, 2023
❗ Release notes required
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Could someone fix the test |
psfinaki
commented
Jan 22, 2024
@Tangent-90 maybe this helps. |
vzarytovskii
commented
Jan 23, 2024
Is this still WIP as title suggests, or ready for review? |
It may need the RFC to be accepted first? |
ijklam
commented
Jan 23, 2024
@vzarytovskii Title changed, it's now ready |
vzarytovskii
commented
Jan 29, 2024
vzarytovskii
commented
Jan 29, 2024
baronfel
commented
Feb 1, 2024
@Tangent-90 I just want to say that this is awesome, the idea is awesome, you are awesome, and I can't wait to use this. |
Uh oh!
There was an error while loading. Please reload this page.
@Tangent-90 thanks a lot for this contribution! |
| FSharp """let (|IsA|_|) x = x = "A" | ||
| match "A" with | ||
| | IsA result -> "A" |
There was a problem hiding this comment.
Why do we try to resolve result to another symbol here (see the error on line 101)? Lowercase names at argument positions are never being resolved to any other symbol in patterns and always create new local values (or are ignored during recovery).
This is very inconsistent to the rest of the language. It should probably be an error about an extra arg instead, definitely not the 'unresolved name' one.
There was a problem hiding this comment.
This is because active pattern returning _ option or _ voption can capture return value by the last argument, but active pattern returning bool doesn't. The test is to check it works.
New error added, see #16846.



Description
Implements this
Current progress:

Checklist
RFC added
Test cases added
Performance benchmarks added in case of performance changes
Release notes entry updated: