mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These are tests that fail in the next commit without this flag. This does not add -verify-ignore-unrelated to all tests with -verify, only the ones that would fail without it. This is NFC since this flag is currently a no-op.
28 lines
1.2 KiB
Swift
28 lines
1.2 KiB
Swift
// RUN: %target-swift-frontend-verify -verify-ignore-unrelated -typecheck %s -enable-objc-interop -import-objc-header %S/../Inputs/objc_direct.h
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
var something = Bar() as AnyObject
|
|
|
|
something.directProperty = 123 // expected-error {{value of type 'AnyObject' has no member 'directProperty'}}
|
|
let _ = something.directProperty // expected-error {{value of type 'AnyObject' has no member 'directProperty'}}
|
|
|
|
something.directProperty2 = 456 // expected-error {{value of type 'AnyObject' has no member 'directProperty2'}}
|
|
let _ = something.directProperty2 // expected-error {{value of type 'AnyObject' has no member 'directProperty2'}}
|
|
|
|
let _ = something.directMethod() // expected-error {{value of type 'AnyObject' has no member 'directMethod'}}
|
|
|
|
let _ = something.directMethod2() // expected-error {{value of type 'AnyObject' has no member 'directMethod2'}}
|
|
|
|
class Foo {
|
|
// Test that we can use a method with the same name as some `objc_direct` method.
|
|
@objc func directProtocolMethod() -> String {
|
|
"This is not a direct method."
|
|
}
|
|
}
|
|
|
|
var otherThing = Foo() as AnyObject
|
|
|
|
// We expect no error.
|
|
let _ = otherThing.directProtocolMethod()
|