Skip to content

[SR-4024] diagnostics for class overrides in extensions are emitted twice #46607

@rudkx

Description

@rudkx
Previous ID SR-4024
Radar rdar://problem/30643549
Original Reporter @rudkx
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee KingOfBrian (JIRA)
Priority Medium

md5: b05c2a7936711a587ba3f144cc07244f

Issue Description:

For this test case:

import Foundation

class Base: NSObject {
  var a: Int { return 0 }
}

class Derived: Base {}

extension Derived {
  override var a: Int { return 1 }
}

We emit diagnostics two times for the overrides in the extensions:

ex.swift:10:16: warning: cannot override a non-dynamic class declaration from an extension
  override var a: Int { return 1 }
               ^
ex.swift:4:7: note: overridden declaration is here
  var a: Int { return 0 }
      ^
ex.swift:10:23: warning: cannot override a non-dynamic class declaration from an extension
  override var a: Int { return 1 }
                      ^
ex.swift:4:14: note: overridden declaration is here
  var a: Int { return 0 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions