swiftlang/swift

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

オープン

#57,499 opened on 2021/09/09

 (31 件のコメント) (0 件のリアクション) (1 人の担当者)Swift (10,719 件のフォーク)batch import
compilerdiagnostics qualityfix-itsgood first issueimprovementinheritanceoverrideswift 5.9

Repository metrics

Stars
 (69,989 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Previous ID SR-15176
Radar rdar://28337871
Original Reporter @CodaFi
Type Improvement
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.

コントリビューターガイド