-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
featureA feature request or implementationA feature request or implementationtriage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Motivation
when adding new declarations to any data type (class, struct, actor)
it will be nice if the compiler suggest fix-its to init the newly added declarations

Proposed solution
it will be nice if the compiler provides two fix-its
- appearing on the
init
that if applied, will add the new missing parameters - appearing on the closing brace of init, to add
self.foo=foo
struct Foo {
let name: String
let age: Int //<- newly added variable
init(name: String) {
self.name = name
}
}
the two fix-its should be:
[
{
"file": "/Users/mostafa.essam/Desktop/file2.swift",
"offset": 106,
"text": "\nself.age = age\n"
},
{
"file": "/Users/mostafa.essam/Desktop/file2.swift",
"offset": 73,
"text": ",age: Int"
}
]
Alternatives considered
No response
Additional information
No response
Abdo-codesAbdo-codes
Metadata
Metadata
Assignees
Labels
featureA feature request or implementationA feature request or implementationtriage neededThis issue needs more specific labelsThis issue needs more specific labels