mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Even when building not for library evolution, @frozen is a valid attribute on enums. rdar://128358780
37 lines
936 B
Swift
37 lines
936 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
// RUN: %target-swift-frontend -emit-module %t/Library.swift -emit-module-path %t/Library.swiftmodule -module-name Library
|
|
// RUN: %target-swift-frontend -typecheck -verify -strict-concurrency=complete -swift-version 6 %s -I %t
|
|
|
|
//--- Library.swift
|
|
|
|
@frozen public enum Numquam {}
|
|
|
|
@_fixed_layout public struct Nunca {} // expected-warning {{}}
|
|
|
|
//--- Client.swift
|
|
|
|
public protocol WithSendable {
|
|
associatedtype AssocSendable : Sendable
|
|
}
|
|
|
|
extension Numquam : WithSendable {
|
|
public typealias AssocSendable = Numquam
|
|
}
|
|
|
|
extension Nunca : WithSendable {
|
|
public typealias AssocSendable = Nunca
|
|
}
|
|
|
|
public protocol WithBitwiseCopyable {
|
|
associatedtype AssocBitwiseCopyable : BitwiseCopyable
|
|
}
|
|
|
|
extension Numquam : WithBitwiseCopyable {
|
|
public typealias AssocBitwiseCopyable = Numquam
|
|
}
|
|
|
|
extension Nunca : WithBitwiseCopyable {
|
|
public typealias AssocBitwiseCopyable = Nunca
|
|
}
|