Skip to content

[SR-15176] Fixit for override func that should be override var #57499

Open
@CodaFi

Description

@CodaFi
Previous ID SR-15176
Radar rdar://28337871
Original Reporter @CodaFi
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, StarterBug
Assignee jiaren wang (JIRA)
Priority Medium

md5: b17661d61829d04b65f822d78b07388a

Issue Description:

Consider

class C {
  var canBecomeFirstResponder: Bool

  init() {}
}

class D: C {
    override func canBecomeFirstResponder() -> Bool {
    }
}

We should add a special case to diagnoseGeneralOverrideFailure that tries to see if it can correct no-args FuncDecls to VarDecls and vice-versa.

Metadata

Metadata

Assignees

Labels

compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationfix-itsFeature: diagnostic fix-itsgood first issueGood for newcomersimprovementinheritanceFeature → type declarations → class: Subclassing and inheritance of class membersoverrideFeature: Overriding in classesswift 5.9

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions