File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ extension Optional where Wrapped: ~Copyable {
230
230
public borrowing func _borrowingMap< U: ~ Copyable, E: Error > (
231
231
_ transform: ( borrowing Wrapped ) throws ( E ) -> U
232
232
) throws ( E) -> U ? {
233
- #if $NoncopyableGenerics
233
+ #if compiler(>=6.0) && $NoncopyableGenerics
234
234
switch self {
235
235
case . some( _borrowing y) :
236
236
return . some( try transform ( y) )
@@ -289,7 +289,6 @@ extension Optional {
289
289
}
290
290
}
291
291
292
- @_disallowFeatureSuppression ( NoncopyableGenerics)
293
292
extension Optional where Wrapped: ~ Copyable {
294
293
// FIXME(NCG): Make this public.
295
294
@_alwaysEmitIntoClient
@@ -309,12 +308,16 @@ extension Optional where Wrapped: ~Copyable {
309
308
public func _borrowingFlatMap< U: ~ Copyable, E: Error > (
310
309
_ transform: ( borrowing Wrapped ) throws ( E ) -> U ?
311
310
) throws ( E) -> U ? {
311
+ #if compiler(>=6.0) && $NoncopyableGenerics
312
312
switch self {
313
313
case . some( _borrowing y) :
314
314
return try transform ( y)
315
315
case . none:
316
316
return . none
317
317
}
318
+ #else
319
+ fatalError ( " Unsupported compiler " )
320
+ #endif
318
321
}
319
322
}
320
323
You can’t perform that action at this time.
0 commit comments