-
Notifications
You must be signed in to change notification settings - Fork 790
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
FS0049 isn't reported for short names #17878
Comments
This is the problematic code: fsharp/src/Compiler/Checking/NameResolution.fs Line 3395 in 11cb682
If there's no objections, I'd like to remove this check. |
It is a very very very unfortunate historical hack that seems to related the use country and language codes, which are very common in codebases Removing this check will cause a lot of new warnings/errors in existing codebases. I did some investigation here https://github.com/dotnet/fsharp/pull/15816/files |
I think we should remove this check in the next mayor version and explain the reasoning.
|
I still think it's a huge breaking change, before we do it, we need to assess how much code there's in the nuget libraries/github code. |
Agreed that this is a breaking change. Not sure about the "huge" part. IMO we have done more severe ones like the The compiler should have never check for country codes(US etc). If someone wants this they can use/write an analyser. |
It's worth noting that this warning isn't produced for bindings, so it shouldn't affect symbols exported from libraries. Consider this module: let Aaa = ()
match () with
| Bbb -> () There's no warning for Let's consider another case with local values: match f () with
| Us -> ()
| Uk -> ()
... In this case We can also adjust the let f Us Uk = ... |
@psfinaki Yes. we now report pattern(any length) in a match cases. |
There's a warning reported for this code, saying that it may intent to use non-imported symbol, but defines a new local value instead:
It's, however, not reported for shorter names, which may be the case for various literals, union cases, or active patterns:
The text was updated successfully, but these errors were encountered: