|
5 | 5 | // expected-error@-1 {{@_inlineable cannot be applied to this declaration}}
|
6 | 6 |
|
7 | 7 | private func privateFunction() {}
|
8 |
| -// expected-note@-1 5{{global function 'privateFunction()' is not '@_versioned' or public}} |
| 8 | +// expected-note@-1{{global function 'privateFunction()' is not '@_versioned' or public}} |
9 | 9 | fileprivate func fileprivateFunction() {}
|
10 |
| -// expected-note@-1 5{{global function 'fileprivateFunction()' is not '@_versioned' or public}} |
| 10 | +// expected-note@-1{{global function 'fileprivateFunction()' is not '@_versioned' or public}} |
11 | 11 | func internalFunction() {}
|
12 |
| -// expected-note@-1 5{{global function 'internalFunction()' is not '@_versioned' or public}} |
| 12 | +// expected-note@-1{{global function 'internalFunction()' is not '@_versioned' or public}} |
13 | 13 | @_versioned func versionedFunction() {}
|
14 | 14 | public func publicFunction() {}
|
15 | 15 |
|
16 |
| -func internalIntFunction() -> Int {} |
17 |
| -// expected-note@-1 2{{global function 'internalIntFunction()' is not '@_versioned' or public}} |
18 |
| - |
19 | 16 | private struct PrivateStruct {}
|
20 | 17 | // expected-note@-1 3{{struct 'PrivateStruct' is not '@_versioned' or public}}
|
21 | 18 | struct InternalStruct {}
|
@@ -136,72 +133,6 @@ public struct Struct {
|
136 | 133 | }
|
137 | 134 | }
|
138 | 135 |
|
139 |
| -func internalFunctionWithDefaultValue( |
140 |
| - x: Int = { |
141 |
| - struct Nested {} |
142 |
| - // OK |
143 |
| - |
144 |
| - publicFunction() |
145 |
| - // OK |
146 |
| - versionedFunction() |
147 |
| - // OK |
148 |
| - internalFunction() |
149 |
| - // OK |
150 |
| - fileprivateFunction() |
151 |
| - // OK |
152 |
| - privateFunction() |
153 |
| - // OK |
154 |
| - |
155 |
| - return 0 |
156 |
| - }(), |
157 |
| - y: Int = internalIntFunction()) {} |
158 |
| - |
159 |
| -@_versioned func versionedFunctionWithDefaultValue( |
160 |
| - x: Int = { |
161 |
| - struct Nested {} |
162 |
| - // expected-error@-1 {{type 'Nested' cannot be nested inside a default argument value}} |
163 |
| - |
164 |
| - // FIXME: Some errors below are diagnosed twice |
165 |
| - |
166 |
| - publicFunction() |
167 |
| - // OK |
168 |
| - versionedFunction() |
169 |
| - // OK |
170 |
| - internalFunction() |
171 |
| - // expected-error@-1 2{{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}} |
172 |
| - fileprivateFunction() |
173 |
| - // expected-error@-1 2{{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}} |
174 |
| - privateFunction() |
175 |
| - // expected-error@-1 2{{global function 'privateFunction()' is private and cannot be referenced from a default argument value}} |
176 |
| - |
177 |
| - return 0 |
178 |
| - }(), |
179 |
| - y: Int = internalIntFunction()) {} |
180 |
| - // expected-error@-1 {{global function 'internalIntFunction()' is internal and cannot be referenced from a default argument value}} |
181 |
| - |
182 |
| -public func publicFunctionWithDefaultValue( |
183 |
| - x: Int = { |
184 |
| - struct Nested {} |
185 |
| - // expected-error@-1 {{type 'Nested' cannot be nested inside a default argument value}} |
186 |
| - |
187 |
| - // FIXME: Some errors below are diagnosed twice |
188 |
| - |
189 |
| - publicFunction() |
190 |
| - // OK |
191 |
| - versionedFunction() |
192 |
| - // OK |
193 |
| - internalFunction() |
194 |
| - // expected-error@-1 2{{global function 'internalFunction()' is internal and cannot be referenced from a default argument value}} |
195 |
| - fileprivateFunction() |
196 |
| - // expected-error@-1 2{{global function 'fileprivateFunction()' is fileprivate and cannot be referenced from a default argument value}} |
197 |
| - privateFunction() |
198 |
| - // expected-error@-1 2{{global function 'privateFunction()' is private and cannot be referenced from a default argument value}} |
199 |
| - |
200 |
| - return 0 |
201 |
| - }(), |
202 |
| - y: Int = internalIntFunction()) {} |
203 |
| - // expected-error@-1 {{global function 'internalIntFunction()' is internal and cannot be referenced from a default argument value}} |
204 |
| - |
205 | 136 | // Make sure protocol extension members can reference protocol requirements
|
206 | 137 | // (which do not inherit the @_versioned attribute).
|
207 | 138 | @_versioned
|
|
0 commit comments