forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuperclass_constraint_metadata_objc_superclass.swift
41 lines (32 loc) · 1.21 KB
/
superclass_constraint_metadata_objc_superclass.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-library -enable-library-evolution -module-name Framework -module-link-name Framework %S/Inputs/public_struct_with_generic_arg_nsobject_constrained.swift -o %t/%target-library-name(Framework) -emit-module-path %t/Framework.swiftmodule
// RUN: %target-codesign %t/libFramework.dylib
// RUN: %target-build-swift %s %S/Inputs/print_subclass/main.swift -module-name main -o %t/main -I %t -L %t
// RUN: %target-codesign %t/main
// RUN: %target-run %t/main | %FileCheck %S/Inputs/print_subclass/main.swift
// REQUIRES: objc_interop
// REQUIRES: executable_test
// REQUIRES: OS=macosx
// UNSUPPORTED: use_os_stdlib
import Swift
import Foundation
import Framework
// Swift subclass of a ObjC class
// subclass isSwiftClassMetadataSubclass metadata completeness : Complete
// superclass metadata path: loop
// iteration 1: subclass->Superclass == NSObject
// subclass <= NSObject
// superclass == NSObject; done
typealiasGen=Framework.Gen<Subclass>
publicclassSubclass:NSObject{
overrideinit(){
self.gen =Gen()
super.init()
}
vargen:Gen?
}
@inline(never)
publicfunc consume<T>(_ t:T){
withExtendedLifetime(t){ t in
}
}