mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The `_Concurrency` and `_StringProcessing` modules are implementation details of the standard library; to developers, their contents should behave as though they are declared directly within module `Swift`. This is the exact same behavior we expect of cross-import overlays, so treat these modules as though they are cross-import overlays with no bystanding module. Because these modules don’t re-export the standard library, it’s also necessary to treat `Swift` as a separately imported overlay of itself; do so and make that actually work.
25 lines
956 B
Swift
25 lines
956 B
Swift
// RUN: %empty-directory(%t)
|
|
|
|
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/ShadowsConcur.swiftmodule -module-name ShadowsConcur %S/Inputs/ShadowsConcur.swift
|
|
|
|
// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify
|
|
// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted
|
|
// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete
|
|
|
|
// REQUIRES: concurrency
|
|
|
|
import ShadowsConcur
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
func f(_ t : UnsafeCurrentTask) -> Bool {
|
|
return t.someProperty == "123"
|
|
}
|
|
|
|
@available(SwiftStdlib 5.1, *)
|
|
func g(_: _Concurrency.UnsafeCurrentTask) {}
|
|
|
|
// Should also be allowed since _Concurrency is a separately-imported overlay of
|
|
// the standard library.
|
|
@available(SwiftStdlib 5.1, *)
|
|
func h(_: Swift.UnsafeCurrentTask) {}
|