-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationexpressionsFeature: expressionsFeature: expressionsfix-itsFeature: diagnostic fix-itsFeature: diagnostic fix-itsfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersmutabilityFeature: storage mutabilityFeature: storage mutabilityswift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
Description
We could offer to declare a mutable var x = x
copy above the failing expression below.
Reproduction
func f(x: Int) {
x = 3
x += 3
}
Expected behavior
Fix-it to declare a variable.
Environment
Swift version 6.2-dev (LLVM 736ebbfa5fe3371, Swift d033eec)
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of ImplementationexpressionsFeature: expressionsFeature: expressionsfix-itsFeature: diagnostic fix-itsFeature: diagnostic fix-itsfunction parametersFeature → declarations: function parametersFeature → declarations: function parametersmutabilityFeature: storage mutabilityFeature: storage mutabilityswift 6.2type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis