Skip to content

[SR-993] Objc class extensions don't support stored type properties, error message is confusing #43605

@an0

Description

@an0
mannequin
Previous ID SR-993
Radar radar://20512544
Original Reporter @an0
Type Bug
Status Resolved
Resolution Done
Environment

Swift 3 in Xcode 8.0 beta 3

Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: d9305dc29182276d2baf4b7f5081f44f

is duplicated by:

  • SR-2386 Error when adding static stored properties to Objective-C classes in extensions

Issue Description:

I guess currently ObjC class extensions don't support stored type properties. But the error message is very confusing and without any location information:

a declaration cannot be both 'final' and 'dynamic'

import Foundation

extension Int {
    // Swift extensions support stored type properties.
    static let a = 1
}

class Foo: NSObject {}

extension Foo {
    static let a = 1
}

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 Implementationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions