mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
...and update the print-as-ObjC type printer to handle them. IRGen and @encode changes to come from Mark and Fariborz, presumably. Swift SVN r12938
17 lines
614 B
Swift
17 lines
614 B
Swift
// RUN: %swift %s %clang-importer-sdk -verify
|
|
|
|
import ObjectiveC
|
|
|
|
struct NativeStruct {}
|
|
|
|
class Test {
|
|
@objc func invalid() -> NativeStruct { return NativeStruct() }
|
|
// expected-error@-1 {{method cannot be marked @objc because its result type cannot be represented in Objective-C}}
|
|
// expected-note@-2 {{Swift structs cannot be represented in Objective-C}}
|
|
|
|
@objc func selector(sel: Selector) {} // no-warning
|
|
@objc func selectorRef(sel: UnsafePointer<Selector>) {} // no-warning
|
|
@objc func boolean(b: ObjCBool) {} // no-warning
|
|
@objc func booleanRef(ref: UnsafePointer<ObjCBool>) {} // no-warning
|
|
}
|