mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Always disable requiring Foundation for '@objc' when building/typechecking interfaces
This commit is contained in:
@@ -735,6 +735,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
|||||||
OPT_disable_testable_attr_requires_testable_module)) {
|
OPT_disable_testable_attr_requires_testable_module)) {
|
||||||
Opts.EnableTestableAttrRequiresTestableModule
|
Opts.EnableTestableAttrRequiresTestableModule
|
||||||
= A->getOption().matches(OPT_enable_testable_attr_requires_testable_module);
|
= A->getOption().matches(OPT_enable_testable_attr_requires_testable_module);
|
||||||
|
} else if (FrontendOpts.RequestedAction ==
|
||||||
|
FrontendOptions::ActionType::TypecheckModuleFromInterface ||
|
||||||
|
FrontendOpts.RequestedAction ==
|
||||||
|
FrontendOptions::ActionType::CompileModuleFromInterface) {
|
||||||
|
Opts.EnableObjCAttrRequiresFoundation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Args.getLastArg(OPT_debug_cycles))
|
if (Args.getLastArg(OPT_debug_cycles))
|
||||||
|
|||||||
13
test/ModuleInterface/ExplicitInterfaceObjC.swiftinterface
Normal file
13
test/ModuleInterface/ExplicitInterfaceObjC.swiftinterface
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// swift-interface-format-version: 1.0
|
||||||
|
// swift-module-flags: -module-name ExplicitInterfaceObjC
|
||||||
|
|
||||||
|
// REQUIRES: objc_interop, OS=macosx
|
||||||
|
// RUN: %empty-directory(%t)
|
||||||
|
|
||||||
|
// RUN: %target-swift-frontend -compile-module-from-interface -module-name ExplicitInterfaceObjC -explicit-interface-module-build -o %/t/ExplicitInterfaceObjC.swiftmodule %s -verify
|
||||||
|
// RUN: %target-swift-frontend -typecheck-module-from-interface -module-name ExplicitInterfaceObjC -explicit-interface-module-build -o %/t/ExplicitInterfaceObjC.swiftmodule %s -verify
|
||||||
|
import Swift
|
||||||
|
|
||||||
|
final public class Foo {
|
||||||
|
@objc deinit
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user