-
Notifications
You must be signed in to change notification settings - Fork 832
Warn when record update expression changes all fields #14673
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
|
Build failures stem from this diagnostic being triggered when compiling FSharp.Core: /// Produce a new execution context for a composite async
member _.WithContinuations(cont, econt) =
AsyncActivation<'U> // <------------- ok, 2 fields, construction syntax
{
cont = cont
aux = { contents.aux with econt = econt }
}
/// Produce a new execution context for a composite async
member ctxt.WithContinuations(cont, econt, ccont) =
AsyncActivation<'T>
{ contents with // <------------- warning, 2 fields, update syntax
cont = cont
aux =
{ ctxt.aux with
econt = econt
ccont = ccont
}
} |
|
Can you please put it off by default in current versions and on under preview version? This way, I guess, we can have it off now, but optionally enabled if users want it, and on by default in preview/8? |
|
@kerams you are really doing an amazing job with these PRs, thanks a lot. Considering the level of the warning, IMO can be whatever since yeah we don't expect this to happen often to be anyhow noisy. |
It should not be enabled by default for current language versions, a rule of thumb is usually "if it will break anyone's compilation simply by upgrading to a minor SDK, then it go under language flag" |
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.
I like the new approach via the exception type - it can be also reused for other scenarios where we want the same ( combination of langfeature + still allowing explicit opt-in for older versions).
Good.
Implements fsharp/fslang-suggestions#603.
There has been some opposition to the suggestion. Should this maybe be off by default or part of warning level 4?