Files
swift-mirror/test/Generics/requirement_inference_preconcurrency.swift
Holly Borla 679825063a [RequirementMachine] Only skip Sendable requirements inferred from preconcurrency
decls if the decl we're inferring the generic signature for is not itself
preconcurrency.
2023-01-19 20:28:50 -08:00

22 lines
821 B
Swift

// RUN: %target-swift-frontend -typecheck %s -debug-generic-signatures 2>&1 | %FileCheck %s
// CHECK-LABEL: ExistingType
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Sendable>
@preconcurrency
public struct ExistingType<T: Sendable> : Sendable {}
// CHECK-LABEL: existingClient(arg:)
// CHECK: Canonical generic signature: <τ_0_0>
public func existingClient<T>(arg: T.Type) -> ExistingType<T>? { nil }
public typealias Alias = ExistingType
// CHECK-LABEL: existingClient2(arg:)
// CHECK: Canonical generic signature: <τ_0_0>
public func existingClient2<T>(arg: T.Type) -> Alias<T>? { nil }
// CHECK-LABEL: preconcurrencyClient(arg:)
// CHECK: Canonical generic signature: <τ_0_0 where τ_0_0 : Sendable>
@preconcurrency
public func preconcurrencyClient<T>(arg: T.Type) -> ExistingType<T>? { nil }