Files
swift-mirror/test/Sema/objc_attr_requires_module_3.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

44 lines
721 B
Swift

// RUN: %target-build-swift -typecheck %s -Xfrontend -verify
class TestClass1 {
#if false
@objc func testMethod() {} // OK, in inactive block
#endif
}
#if false
class TestClass2 {
@objc func testMethod() {} // OK, in inactive block
}
#endif
#if false
class TestClass3 {
#if true
@objc func testMethod() {} // OK, in inactive block
#endif
}
#endif
#if false
#if true
class TestClass4 {
@objc func testMethod() {} // OK, in inactive block
}
#endif
#endif
class TestClass5 {
#if true
// pass
#else
@objc func testMethod() {} // OK, in inactive block
#endif
}
#if true
class TestClass6 {
@objc func testMethod() {} // expected-error {{@objc attribute used without importing module 'Foundation'}}
}
#endif