-
Notifications
You must be signed in to change notification settings - Fork 847
Small cleanup in code fixes + tests for a legacy code fix #15934
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
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
T-Gro
left a comment
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 I read things correctly, I do not really see the need to remove code which supports an error which is still being produced by the compiler codebase.
At least these two snippets in existing main are able to produce it:
if g.langVersion.IsExplicitlySpecifiedAs50OrBefore() then
error (NotAFunctionButIndexer(denv, overallTy.Commit, vName, mExpr, mArg, false)) let old = not (g.langVersion.SupportsFeature LanguageFeature.IndexerNotationWithoutDot)
error (NotAFunctionButIndexer(denv, overallTy.Commit, vName, mExpr, mArg, old))
Either not remove at all, or remove from everywhere properly (which would mean intentionally dropping support for something specified as a LanguageFeature).
|
@T-Gro Yeah I was trying to understand this but failed to. Do you know which code would generate this error and how is it supposed to change after applying the code fix (given that it works)? I mean, we don't have any tests for the diag in question and the commit introducing the code fix was pushed long ago and somehow without a PR so no example there either. AFAIU the whole thing, even if everything somehow works, this would basically produce some code like WDYT? |
Context is everything - you have to look at it with lenses of a project being on an older F# version, for whatever reason. The compiler does support staying on a lower version, and the code in the compiler which does produce this error still exists. The codefix was already written, I don't think we should remove it just for the sake of changing something. (I am not saying we should start writing codefixes for older F# versions. But if one was already written and we still support that older version officially, I don't see added value in removing it) |
|
In principle I don't mind keeping it - and even putting it on the wheels of the code fix framework I am developing here. I just want to see if it works even (chances are it doesn't). But I don't understand (I tried!) what it should fix and how. If you come up with an example, I don't mind keeping it / fixing it. But if we cannot come up with a usecase, it doesn't make sense to me to keep it. @KevinRansom maybe rings a bell for you? |
Having a project with F# version pre-dating the dot-less indexer, and then doing something similar to Does not trigger it? |
|
@T-Gro hah right, it does get triggered (and works) on F#5, I was trying things out with F#6 only. 🤔 Agree then, shouldn't be a big deal to do things properly here, hang on. |
316b0b3 to
4a5a9bb
Compare
|
Okay so that's done, @T-Gro thanks for being not as careless as I was here :D |
This: