forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconditional_conformances_modules.swift
84 lines (71 loc) · 3.36 KB
/
conditional_conformances_modules.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/%target-library-name(Basic)) %S/../Inputs/conditional_conformance_basic_conformances.swift -module-name Basic -emit-module -emit-module-path %t/Basic.swiftmodule
// RUN: %target-build-swift-dylib(%t/%target-library-name(WithAssoc)) %S/../Inputs/conditional_conformance_with_assoc.swift -module-name WithAssoc -emit-module -emit-module-path %t/WithAssoc.swiftmodule
// RUN: %target-build-swift-dylib(%t/%target-library-name(Subclass)) %S/../Inputs/conditional_conformance_subclass.swift -module-name Subclass -emit-module -emit-module-path %t/Subclass.swiftmodule
// RUN: %target-build-swift -I%t -L%t -lBasic -lWithAssoc -lSubclass %s -o %t/conditional_conformances_modules %target-rpath(%t)
// RUN: %target-codesign %t/conditional_conformances_modules
// RUN: %target-run %t/conditional_conformances_modules %t/%target-library-name(Basic) %t/%target-library-name(WithAssoc) %t/%target-library-name(Subclass)
// REQUIRES: executable_test
// FIXME: seems to fail on 32-bit simulator?
// REQUIRES: OS=macosx || OS=linux-gnu || OS=linux-androideabi || OS=linux-android
import Basic
import WithAssoc
import Subclass
public func basic_single_generic<T: Basic.P2>(_: T.Type) {
Basic.takes_p1(Basic.Single<T>.self)
}
public func basic_single_concrete() {
Basic.takes_p1(Basic.Single<Basic.IsP2>.self)
}
public func basic_double_generic_generic<U: Basic.P2, V: Basic.P3>(_: U.Type, _: V.Type) {
Basic.takes_p1(Basic.Double<U, V>.self)
}
public func basic_double_generic_concrete<X: Basic.P2>(_: X.Type) {
Basic.takes_p1(Basic.Double<X, Basic.IsP3>.self)
}
public func basic_double_concrete_concrete() {
Basic.takes_p1(Basic.Double<Basic.IsP2, Basic.IsP3>.self)
}
public func with_assoc_generic_generic<T: WithAssoc.P2, U>(_: T.Type, _: U.Type)
where T.AT2: WithAssoc.P2, U: WithAssoc.P3, T.AT2.AT2.AT3: WithAssoc.P3
{
WithAssoc.takes_p1(WithAssoc.Double<T, U>.self)
}
public func with_assoc_generic_concrete<T: WithAssoc.P2>(_: T.Type)
where T.AT2: WithAssoc.P2, T.AT2.AT2.AT3: WithAssoc.P3
{
WithAssoc.takes_p1(WithAssoc.Double<T, WithAssoc.IsP3>.self)
}
public func with_assoc_concrete_generic<U>(_: U.Type)
where U: WithAssoc.P3
{
WithAssoc.takes_p1(WithAssoc.Double<WithAssoc.IsAlsoP2, U>.self)
}
public func with_assoc_concrete_concrete() {
WithAssoc.takes_p1(WithAssoc.Double<WithAssoc.IsAlsoP2, WithAssoc.IsP3>.self)
}
public func subclass_subclassgeneric_generic<T: Subclass.P2>(_: T.Type) {
Subclass.takes_p1(Subclass.SubclassGeneric<T>.self)
}
public func subclass_subclassgeneric_concrete() {
Subclass.takes_p1(Subclass.SubclassGeneric<Subclass.IsP2>.self)
}
public func subclass_subclassconcrete() {
Subclass.takes_p1(Subclass.SubclassConcrete.self)
}
public func subclass_subclassgenericconcrete() {
Subclass.takes_p1(Subclass.SubclassGenericConcrete.self)
}
basic_single_generic(Basic.IsP2.self)
basic_single_concrete()
basic_double_generic_generic(Basic.IsP2.self, Basic.IsP3.self)
basic_double_generic_concrete(Basic.IsP2.self)
basic_double_concrete_concrete()
with_assoc_generic_generic(WithAssoc.IsAlsoP2.self, WithAssoc.IsP3.self)
with_assoc_generic_concrete(WithAssoc.IsAlsoP2.self)
with_assoc_concrete_generic(WithAssoc.IsP3.self)
with_assoc_concrete_concrete()
subclass_subclassgeneric_generic(Subclass.IsP2.self)
subclass_subclassgeneric_concrete()
subclass_subclassconcrete()
subclass_subclassgenericconcrete()