swiftlang/swift

[SR-13388] Add Fix-Its to "override" mismatch

Open

#55,828 opened on Aug 13, 2020

View on GitHub
 (9 comments) (0 reactions) (0 assignees)Swift (10,719 forks)batch import
compilergood first issueimprovement

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (Avg merge 8d 17h) (510 merged PRs in 30d)

Description

Previous ID SR-13388
Radar rdar://problem/66539331
Original Reporter @DougGregor
Type Improvement
Status In Progress
Resolution
Votes 0
Component/s Compiler
Labels Improvement, StarterBug
Assignee RoyCao (JIRA)
Priority Medium

md5: be871146c13ac26dbbf04275c83c2233

Issue Description:

For code like this following:

class Base {
  func foo(a: Int, b: Int) {}
}
class C: Base {
  override func foo(a: Int) {} // error: method does not override any method from its superclass
}

we should provide a Fix-It that adds ", b: Int" to C.foo.

Contributor guide