Files
swift-mirror/test/decl/protocol/conforms/actor_derived.swift
Karoy Lorentey 47956908b7 [Concurrency] SwiftStdlib 5.5 ⟹ SwiftStdlib 5.1 (usages)
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib.

Adjust macro usages accordingly.
2021-10-28 14:36:36 -07:00

31 lines
1.0 KiB
Swift

// RUN: %target-typecheck-verify-swift
// REQUIRES: concurrency
@available(SwiftStdlib 5.1, *)
actor A1: Hashable {
nonisolated func hash(into hasher: inout Hasher) { }
static func ==(lhs: A1, rhs: A1) -> Bool { true }
}
@available(SwiftStdlib 5.1, *)
actor A2: Hashable {
nonisolated var hashValue: Int { 0 } // expected-warning{{'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'A2' to 'Hashable' by implementing 'hash(into:)' instead}}
static func ==(lhs: A2, rhs: A2) -> Bool { true }
}
@available(SwiftStdlib 5.1, *)
@MainActor
class C1: Hashable {
nonisolated func hash(into hasher: inout Hasher) { }
nonisolated static func ==(lhs: C1, rhs: C1) -> Bool { true }
}
@available(SwiftStdlib 5.1, *)
@MainActor
class C2: Hashable {
nonisolated var hashValue: Int { 0 } // expected-warning{{'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'C2' to 'Hashable' by implementing 'hash(into:)' instead}}
nonisolated static func ==(lhs: C2, rhs: C2) -> Bool { true }
}