mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Don't print @_staticInitializeObjCMetadata
This attribute is computed during the build and is rejected by the parser. Make sure not to print it. Fixes rdar://56923079
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// RUN: %target-swift-frontend -typecheck -emit-module-interface-path - %s -enable-library-evolution -target %target-pre-stable-abi-triple -module-name Module | %FileCheck %s
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
import Foundation
|
||||
|
||||
// To infer @_staticInitializeObjCMetadata, the following needs to be true
|
||||
// Our class needs to be:
|
||||
// - A subclass of a generic Objective-C class
|
||||
// - That inherits a conformance to a protocol
|
||||
// - Declared in a module with a deployment target before the stable ABI
|
||||
|
||||
public class Super<T>: NSObject, NSCoding {
|
||||
required public init(coder: NSCoder) {}
|
||||
public func encode(with: NSCoder) {}
|
||||
}
|
||||
|
||||
// CHECK-NOT: @_staticInitializeObjCMetadata
|
||||
// CHECK: public class Sub : Module.Super<Swift.Int>
|
||||
public class Sub: Super<Int> {
|
||||
required public init(coder: NSCoder) {}
|
||||
override public func encode(with: NSCoder) {}
|
||||
}
|
||||
Reference in New Issue
Block a user