You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Parse/versioned_canimport.swift
+97-23Lines changed: 97 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -20,57 +20,131 @@ import Bar
20
20
#endif
21
21
22
22
func canImportVersioned(){
23
-
#if canImport(Foo, _version: 113.331)
24
-
leta=1
23
+
#if canImport(Foo, _version: 0)
24
+
letmajorZero=1 // expected-warning {{initialization of immutable value 'majorZero' was never used; consider replacing with assignment to '_' or removing it}}
25
25
#endif
26
26
27
-
#if canImport(Foo, _version: 113.3000)
28
-
letb=1
27
+
#if canImport(Foo, _version: 112)
28
+
letmajorSmaller=1 // expected-warning {{initialization of immutable value 'majorSmaller' was never used; consider replacing with assignment to '_' or removing it}}
29
+
#endif
30
+
31
+
#if canImport(Foo, _version: 113)
32
+
letmajorEqual=1 // expected-warning {{initialization of immutable value 'majorEqual' was never used; consider replacing with assignment to '_' or removing it}}
29
33
#endif
30
34
31
35
#if canImport(Foo, _version: 114)
32
-
letc=1
36
+
letmajorLarger=1
37
+
#endif
38
+
39
+
#if canImport(Foo, _version: 113.329)
40
+
letminorSmaller=1 // expected-warning {{initialization of immutable value 'minorSmaller' was never used; consider replacing with assignment to '_' or removing it}}
33
41
#endif
34
42
35
-
#if canImport(Foo, _version: 4)
36
-
letd=1 // expected-warning {{initialization of immutable value 'd' was never used; consider replacing with assignment to '_' or removing it}}
43
+
#if canImport(Foo, _version: 113.330)
44
+
letminorEqual=1 // expected-warning {{initialization of immutable value 'minorEqual' was never used; consider replacing with assignment to '_' or removing it}}
37
45
#endif
38
46
39
-
#if canImport(Foo, _version: 113.33)
40
-
lete=1 // expected-warning {{initialization of immutable value 'e' was never used; consider replacing with assignment to '_' or removing it}}
47
+
#if canImport(Foo, _version: 113.331)
48
+
letminorLarger=1
49
+
#endif
50
+
51
+
#if canImport(Foo, _version: 113.330.0)
52
+
letpatchSmaller=1 // expected-warning {{initialization of immutable value 'patchSmaller' was never used; consider replacing with assignment to '_' or removing it}}
41
53
#endif
42
54
43
-
#if canImport(Foo, _underlyingVersion: 113.33)
44
-
letee=1
55
+
#if canImport(Foo, _version: 113.330.1)
56
+
letpatchEqual=1 // expected-warning {{initialization of immutable value 'patchEqual' was never used; consider replacing with assignment to '_' or removing it}}
57
+
#endif
58
+
59
+
#if canImport(Foo, _version: 113.330.2)
60
+
letpatchLarger=1
45
61
#endif
46
62
47
-
#if canImport(Foo, _version: 113.329)
48
-
letf=1 // expected-warning {{initialization of immutable value 'f' was never used; consider replacing with assignment to '_' or removing it}}
63
+
#if canImport(Foo, _version: 113.330.1.1)
64
+
letbuildSmaller=1 // expected-warning {{initialization of immutable value 'buildSmaller' was never used; consider replacing with assignment to '_' or removing it}}
49
65
#endif
50
66
51
-
#if canImport(Foo, _version: 113.330)
52
-
letg=1 // expected-warning {{initialization of immutable value 'g' was never used; consider replacing with assignment to '_' or removing it}}
67
+
#if canImport(Foo, _version: 113.330.1.2)
68
+
letbuildEqual=1 // expected-warning {{initialization of immutable value 'buildEqual' was never used; consider replacing with assignment to '_' or removing it}}
69
+
#endif
70
+
71
+
#if canImport(Foo, _version: 113.330.1.3)
72
+
letbuildLarger=1
73
+
#endif
74
+
75
+
#if canImport(Foo, _version: 113.330.1.2.0) // expected-warning {{trailing components of version '113.330.1.2' are ignored}}
76
+
letextraComponent=1 // expected-warning {{initialization of immutable value 'extraComponent' was never used; consider replacing with assignment to '_' or removing it}}
77
+
#endif
78
+
79
+
#if canImport(Foo, _underlyingVersion: 113.33)
80
+
// Foo is a Swift module with no underlying clang module.
81
+
letunderlyingMinorSmaller=1
53
82
#endif
54
83
55
84
#if canImport(Foo)
56
-
leth=1 // expected-warning {{initialization of immutable value 'h' was never used; consider replacing with assignment to '_' or removing it}}
85
+
letnoVersion=1 // expected-warning {{initialization of immutable value 'noVersion' was never used; consider replacing with assignment to '_' or removing it}}
57
86
#endif
58
87
}
59
88
60
89
func canImportVersionedString(){
90
+
#if canImport(Foo, _version: "0")
91
+
letmajorZero=1 // expected-warning {{initialization of immutable value 'majorZero' was never used; consider replacing with assignment to '_' or removing it}}
92
+
#endif
93
+
94
+
#if canImport(Foo, _version: "112")
95
+
letmajorSmaller=1 // expected-warning {{initialization of immutable value 'majorSmaller' was never used; consider replacing with assignment to '_' or removing it}}
96
+
#endif
97
+
98
+
#if canImport(Foo, _version: "113")
99
+
letmajorEqual=1 // expected-warning {{initialization of immutable value 'majorEqual' was never used; consider replacing with assignment to '_' or removing it}}
100
+
#endif
101
+
102
+
#if canImport(Foo, _version: "114")
103
+
letmajorLarger=1
104
+
#endif
105
+
106
+
#if canImport(Foo, _version: "113.329")
107
+
letminorSmaller=1 // expected-warning {{initialization of immutable value 'minorSmaller' was never used; consider replacing with assignment to '_' or removing it}}
108
+
#endif
109
+
110
+
#if canImport(Foo, _version: "113.330")
111
+
letminorEqual=1 // expected-warning {{initialization of immutable value 'minorEqual' was never used; consider replacing with assignment to '_' or removing it}}
112
+
#endif
113
+
61
114
#if canImport(Foo, _version: "113.331")
62
-
leta=1
115
+
letminorLarger=1
116
+
#endif
117
+
118
+
#if canImport(Foo, _version: "113.330.0")
119
+
letpatchSmaller=1 // expected-warning {{initialization of immutable value 'patchSmaller' was never used; consider replacing with assignment to '_' or removing it}}
120
+
#endif
121
+
122
+
#if canImport(Foo, _version: "113.330.1")
123
+
letpatchEqual=1 // expected-warning {{initialization of immutable value 'patchEqual' was never used; consider replacing with assignment to '_' or removing it}}
124
+
#endif
125
+
126
+
#if canImport(Foo, _version: "113.330.2")
127
+
letpatchLarger=1
63
128
#endif
64
129
65
-
#if canImport(Foo, _version: "113.3000")
66
-
letb=1
130
+
#if canImport(Foo, _version: "113.330.1.1")
131
+
letbuildSmaller=1 // expected-warning {{initialization of immutable value 'buildSmaller' was never used; consider replacing with assignment to '_' or removing it}}
67
132
#endif
68
133
69
-
#if canImport(Foo, _version: "4")
70
-
letd=1 // expected-warning {{initialization of immutable value 'd' was never used; consider replacing with assignment to '_' or removing it}}
134
+
#if canImport(Foo, _version: "113.330.1.2")
135
+
letbuildEqual=1 // expected-warning {{initialization of immutable value 'buildEqual' was never used; consider replacing with assignment to '_' or removing it}}
136
+
#endif
137
+
138
+
#if canImport(Foo, _version: "113.330.1.3")
139
+
letbuildLarger=1
140
+
#endif
141
+
142
+
#if canImport(Foo, _version: "113.330.1.2.0") // expected-warning {{trailing components of version '113.330.1.2' are ignored}}
143
+
letextraComponent=1 // expected-warning {{initialization of immutable value 'extraComponent' was never used; consider replacing with assignment to '_' or removing it}}
71
144
#endif
72
145
73
-
#if canImport(Foo, _version: "113.33")
74
-
lete=1 // expected-warning {{initialization of immutable value 'e' was never used; consider replacing with assignment to '_' or removing it}}
146
+
#if canImport(Foo, _underlyingVersion: 113.33)
147
+
// Foo is a Swift module with no underlying clang module.
0 commit comments