Files
swift-mirror/test/IRGen/async/weak_availability.swift
Doug Gregor dc85ae3fc6 Choose between AsyncIteratorProtocol's next() and nextElement() based on availability
This allows us to not break backward deployment
2024-01-25 16:04:47 -08:00

14 lines
547 B
Swift

// RUN: %target-swift-frontend -enable-implicit-dynamic -target %target-cpu-apple-macosx10.14 -Onone -emit-ir %s | %FileCheck --check-prefix=MAYBE-AVAILABLE %s
// REQUIRES: OS=macosx && CPU=x86_64
@available(macOS 12.0, *)
public func f<S: AsyncSequence>(_ s: S) async throws -> Any.Type {
for try await _ in s { }
typealias Fn = @MainActor () -> S.Element
return Fn.self
}
// MAYBE-AVAILABLE: @"$sScI{{.*next.*}}YaKFTjTu" = extern_weak global
// MAYBE-AVAILABLE: declare{{.*}} extern_weak{{.*}} @swift_getFunctionTypeMetadataGlobalActor