You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swift 2.2: 7.3.1 (7D1014) Swift 3.0: Xcode 8.0 beta 6 (8S201h), master ae69ffb
Additional Detail from JIRA
Votes
0
Component/s
Compiler
Labels
Bug
Assignee
None
Priority
Medium
md5: 5547fd5a3e611ef2418c99e0d944a6fc
duplicates:
SR-993 Objc class extensions don't support stored type properties, error message is confusing
Issue Description:
When adding a static stored property to an Objective-C classes in an extension, the compiler fails with the error message A declaration cannot be both 'final' and 'dynamic' which is not associated with any source location.
If TestClass does not inherit from NSObject (and is hence not @objc) the code compiles fine.
If you write class let x = 5 instead of static let x = 5, the compiler fails with the error message Class stored properties not supported in classes; did you mean 'static'? suggesting the static keyword.
If adding static stored properties to @objc classes is not supported in extensions, we should produce a diagnostic that clearly points out the issue (including a source location).
The text was updated successfully, but these errors were encountered:
Environment
Swift 2.2: 7.3.1 (7D1014)
Swift 3.0: Xcode 8.0 beta 6 (8S201h), master ae69ffb
Additional Detail from JIRA
md5: 5547fd5a3e611ef2418c99e0d944a6fc
duplicates:
Issue Description:
When adding a static stored property to an Objective-C classes in an extension, the compiler fails with the error message
A declaration cannot be both 'final' and 'dynamic'
which is not associated with any source location.If
TestClass
does not inherit fromNSObject
(and is hence not@objc
) the code compiles fine.If you write
class let x = 5
instead ofstatic let x = 5
, the compiler fails with the error messageClass stored properties not supported in classes; did you mean 'static'?
suggesting thestatic
keyword.If adding static stored properties to
@objc
classes is not supported in extensions, we should produce a diagnostic that clearly points out the issue (including a source location).The text was updated successfully, but these errors were encountered: