swiftlang/swift

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

Open

#57,499 建立於 2021年9月9日

在 GitHub 查看
 (31 留言) (0 反應) (1 負責人)Swift (10,719 fork)batch import
compilerdiagnostics qualityfix-itsgood first issueimprovementinheritanceoverrideswift 5.9

倉庫指標

Star
 (69,989 star)
PR 合併指標
 (平均合併 8天 17小時) (30 天內合併 510 個 PR)

描述

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.

貢獻者指南