-
Notifications
You must be signed in to change notification settings - Fork 845
Ensure that scripts without the notion of upper/lower case can create du identifiers #9199
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,20 @@ | ||
| // #Regression #Conformance #PatternMatching #ActivePatterns | ||
| // Verify error if Active Patterns do not start with an upper case letter | ||
| //<Expects id="FS0623" status="error" span="(11,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(11,16)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(12,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(13,10)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(14,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0624" status="error" span="(15,7)">The '\|' character is not permitted in active pattern case identifiers</Expects> | ||
| //<Expects id="FS0624" status="error" span="(16,9)">The '\|' character is not permitted in active pattern case identifiers</Expects> | ||
| //<Expects id="FS0623" status="error" span="(12,16)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(13,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(14,10)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0623" status="error" span="(15,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
| //<Expects id="FS0624" status="error" span="(16,7)">The '\|' character is not permitted in active pattern case identifiers</Expects> | ||
| //<Expects id="FS0624" status="error" span="(17,9)">The '\|' character is not permitted in active pattern case identifiers</Expects> | ||
| //<Expects id="FS0623" status="error" span="(18,7)">Active pattern case identifiers must begin with an uppercase letter</Expects> | ||
|
|
||
| let (|positive|negative|) n = if n < 0 then positive else negative | ||
| let (|`` A``|) (x:int) = x | ||
| let (|B1|``+B2``|) (x:int) = if x = 0 then OneA else ``+B2`` | ||
| let (|`` C``|_|) (x:int) = if x = 0 then Some(x) else None | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be better to preserve these cases? So, if produced errors change one day it'll be reflected here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @auduchinok once we do the is letter thingy they will be errors again :-).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it'll be OK. :) What I wanted to say was if there is a test for some particular behavior that is being changed it could be good to keep the test just in case it might be changed again (even accidentally, e.g. if fixing an issue produced by the initial change). It's probably just a good thing to record how the particular behavior is being changed anyway.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @auduchinok mate, I understood mate, was messin' with ya :-) |
||
| let (|``D|E``|F|) (x:int) = if x = 0 then D elif x = 1 then E else F | ||
| let (|G|``H||I``|) (x:int) = if x = 0 then G elif x = 1 then H else ``|I`` | ||
| let (|_J|) (x:int) = _J | ||
|
|
||
| exit 1 | ||
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.
Nit:
Scripts- this comment implies that this change is only relevant for F# scripts. It's also relevant to regular .fs files, yes?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.
@cartermp , scripts in this case means written form of a language.