mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
23 lines
586 B
Plaintext
23 lines
586 B
Plaintext
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-objc-attr-requires-foundation-module -typecheck %s -emit-fixits-path %t.remap
|
|
// RUN: c-arcmt-test %t.remap | arcmt-test -verify-transformed-files %s.result
|
|
import ObjectiveC
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
func foo(an : Any) {
|
|
let a1 : AnyObject
|
|
a1 = an as AnyObject
|
|
let a2 : AnyObject?
|
|
a2 = an as AnyObject
|
|
let a3 : AnyObject!
|
|
a3 = an as AnyObject
|
|
}
|
|
|
|
func foo1(_ an : Any) {
|
|
let obj: AnyObject = an as AnyObject
|
|
}
|
|
|
|
func foo2(_ messageData: Any?) -> AnyObject? {
|
|
return messageData as AnyObject?
|
|
}
|