Files
swift-mirror/test/basic/attr/attr_objc_overlays.swift
Jordan Rose cf1bb3634f Allow Selector and ObjCBool in @objc methods.
...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
2014-01-24 22:27:36 +00:00

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
}