mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
These classes don't show up well in generated headers (rdar://problem/20855568), can't actually be allocated from Objective-C (rdar://problem/17184317), and make the story of "what is exposed to Objective-C" more complicated. Better to just disallow them. All classes are still "id-compatible" in that they can be converted to AnyObject and passed to Objective-C, they secretly implement NSObjectProtocol (via our SwiftObject root class), and their members can still be individually exposed to Objective-C. The frontend flag -disable-objc-attr-requires-foundation-module will disable this requirement as well, which is still necessary for both the standard library and a variety of tests I didn't feel like transforming. Swift SVN r29760
13 lines
308 B
Swift
13 lines
308 B
Swift
// RUN: %target-swift-frontend -sdk %S/Inputs %s -I %S/Inputs -enable-source-import -emit-silgen
|
|
//
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
// rdar://15933538 let decls with StoredObjC storage type should have a getter
|
|
// synthesized, but not a setter.
|
|
@objc
|
|
class C : NSObject {
|
|
let x : Int = 100
|
|
}
|