stdlib: Adopt internal imports to suppress some warnings in tests.

This commit is contained in:
Allan Shortlidge
2024-11-12 21:42:04 -08:00
parent 5ab0385c61
commit 17fd27554b
5 changed files with 30 additions and 29 deletions

View File

@@ -40,22 +40,22 @@ import SwiftPrivate
import SwiftPrivateLibcExtras
import SwiftPrivateThreadExtras
#if canImport(Darwin)
import Darwin
internal import Darwin
#elseif canImport(Glibc)
import Glibc
internal import Glibc
#elseif canImport(Musl)
import Musl
internal import Musl
#elseif canImport(Android)
import Android
internal import Android
#elseif os(WASI)
import WASILibc
internal import WASILibc
#elseif os(Windows)
import CRT
import WinSDK
internal import CRT
internal import WinSDK
#endif
#if _runtime(_ObjC)
import ObjectiveC
internal import ObjectiveC
#else
func autoreleasepool(invoking code: () -> Void) {
// Native runtime does not have autorelease pools. Execute the code

View File

@@ -13,21 +13,21 @@
import SwiftPrivate
import SwiftPrivateLibcExtras
#if canImport(Darwin)
import Darwin
internal import Darwin
#elseif canImport(Glibc)
import Glibc
internal import Glibc
#elseif canImport(Musl)
import Musl
internal import Musl
#elseif canImport(Android)
import Android
internal import Android
#elseif os(WASI)
import WASILibc
internal import WASILibc
#elseif os(Windows)
import CRT
internal import CRT
#endif
#if _runtime(_ObjC)
import Foundation
internal import Foundation
#endif
//

View File

@@ -17,25 +17,25 @@ import SwiftPrivateLibcExtras
#if canImport(Darwin)
#if _runtime(_ObjC)
import Foundation
internal import Foundation
#endif
import Darwin
import var Darwin.errno
internal import Darwin
internal import var Darwin.errno
#elseif canImport(Glibc)
import Glibc
internal import Glibc
#elseif canImport(Musl)
import Musl
internal import Musl
#elseif canImport(Android)
import Android
internal import Android
#elseif os(WASI)
import WASILibc
internal import WASILibc
#elseif os(Windows)
import CRT
import WinSDK
internal import CRT
internal import WinSDK
#endif
#if _runtime(_ObjC)
import ObjectiveC
internal import ObjectiveC
#endif
#if SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY

View File

@@ -29,9 +29,9 @@ let RequestPointerSize = "p"
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS)
import MachO
import Darwin
import var Darwin.errno
internal import MachO
internal import Darwin
internal import var Darwin.errno
#if arch(x86_64) || arch(arm64)
typealias MachHeader = mach_header_64

View File

@@ -4,6 +4,7 @@
import StdlibUnittest
import EnableIf
let x = HasMethodWithEnableIf()
x.onlyEnabledForBool("a")
// CHECK: error: could not substitute parameters for C++ function template 'HasMethodWithEnableIf::onlyEnabledForBool': NSString *
// CHECK: error: could not generate C++ types from the generic Swift types provided; the following Swift type(s) provided to 'HasMethodWithEnableIf::onlyEnabledForBool' could not be converted: String