-
Notifications
You must be signed in to change notification settings - Fork 798
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
Pattern DUCase
matches DUCase _
#9520
Comments
DUCase
matches DUCase _
DUCase
matches DUCase _
DUCase
matches DUCase _
DUCase
matches DUCase _
This must be a recent regression. When I try it in FSI in VS 2019 16.5.4 (yep, still had a copy that wasn't updated), I can see: > type DU = | DUCase of int
let y =
function
| DUCase -> ();;
| DUCase -> ();;
------^^^^^^
C:\[...]\stdin(6,7): error FS0019: This constructor is applied to 0 argument(s) but expects 1 And the same code in 16.7.0 Preview 1.0, it succeeds without error. Which suggests somewhere between 16.5.4 and 16.6.0 it was introduced, and not yet fixed in new previews. EDIT: just updated to Preview 2.0, same there, the error is not shown, but should be. |
This is fixed by this recent PR: #9426 |
Closing as duplicate of #9420 |
This type-checks in VS tooling and works in F# interactive. Behaviour is as if the user had written the correct
| DUCase _ -> ()
This doesn't apply to active patterns, which fail without arguments as expected.
Tested on VS 2019 16.6.0 and "F# Interactive version 10.9.1.0 for F# 4.7".
SharpLab doesn't have the problem and gives expected error.
The text was updated successfully, but these errors were encountered: