Open
Description
Previous ID | SR-11813 |
Radar | rdar://problem/57348907 |
Original Reporter | jfilling (JIRA User) |
Type | Bug |
Attachment: Download
Additional Detail from JIRA
Votes | 0 |
Component/s | libdispatch |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: d0c67de0f8ac39b14364c95a29dd21f6
Issue Description:
It appears that DispatchGroups are Equatable on MacOS, but not on Linux.
Using the following simple test program (as foo.swift):
import Dispatch
let g1 = DispatchGroup()
let g2 = DispatchGroup()
if g1 == g2 {
print("groups are equal")
}
else {
print("groups are NOT equal")
}
On MacOS:
$ swift --version
Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)
Target: x86_64-apple-darwin18.7.0
$ swift foo.swift
groups are NOT equal
On Linux (Ubuntu 18.04):
$ swift --version
Swift version 5.1 (swift-5.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
$ swift foo.swift
foo.swift:8:7: error: binary operator '==' cannot be applied to two 'DispatchGroup' operands
if g1 == g2 {
~~ ^ ~~
foo.swift:8:7: note: overloads for '==' exist with these partially matching parameter lists: ((), ()), ((A, B), (A, B)), ((A, B, C), (A, B, C)), ((A, B, C, D), (A, B, C, D)), ((A, B, C, D, E), (A, B, C, D, E)), ((A, B, C, D, E, F), (A, B, C, D, E, F)), (Any.Type?, Any.Type?), (AnyHashable, AnyHashable), (AnyIndex, AnyIndex), (AnyKeyPath, AnyKeyPath), (Array<Element>, Array<Element>), (ArraySlice<Element>, ArraySlice<Element>), (Bool, Bool), (Character, Character), (ClosedRange<Bound>, ClosedRange<Bound>), (ClosedRange<Bound>.Index, ClosedRange<Bound>.Index), (CodingUserInfoKey, CodingUserInfoKey), (CollectionDifference<ChangeElement>, CollectionDifference<ChangeElement>), (CollectionDifference<ChangeElement>.Change, CollectionDifference<ChangeElement>.Change), (CollectionDifference<ChangeElement>.Index, CollectionDifference<ChangeElement>.Index), (ContiguousArray<Element>, ContiguousArray<Element>), (Dictionary<Key, Value>.Index, Dictionary<Key, Value>.Index), (Dictionary<Key, Value>.Keys, Dictionary<Key, Value>.Keys), (DispatchQoS, DispatchQoS), (DispatchTime, DispatchTime), (DispatchTimeInterval, DispatchTimeInterval), (DispatchWallTime, DispatchWallTime), (EmptyCollection<Element>, EmptyCollection<Element>), (FlattenSequence<Base>.Index, FlattenSequence<Base>.Index), (FloatingPointClassification, FloatingPointClassification), (FloatingPointRoundingRule, FloatingPointRoundingRule), (FloatingPointSign, FloatingPointSign), (Int, Int), (Int16, Int16), (Int32, Int32), (Int64, Int64), (Int8, Int8), (LazyPrefixWhileSequence<Base>.Index, LazyPrefixWhileSequence<Base>.Index), (ManagedBufferPointer<Header, Element>, ManagedBufferPointer<Header, Element>), (Mirror.DisplayStyle, Mirror.DisplayStyle), (Never, Never), (ObjectIdentifier, ObjectIdentifier), (OpaquePointer, OpaquePointer), (Range<Bound>, Range<Bound>), (Result<Success, Failure>, Result<Success, Failure>), (ReversedCollection<Base>.Index, ReversedCollection<Base>.Index), (Self, Other), (Self, RHS), (Set<Element>, Set<Element>), (Set<Element>.Index, Set<Element>.Index), (String, String), (String.Index, String.Index), (UInt, UInt), (UInt16, UInt16), (UInt32, UInt32), (UInt64, UInt64), (UInt8, UInt8), (Unicode.CanonicalCombiningClass, Unicode.CanonicalCombiningClass), (Unicode.GeneralCategory, Unicode.GeneralCategory), (Unicode.NumericType, Unicode.NumericType), (Unicode.Scalar, Unicode.Scalar), (Unicode.UTF32, Unicode.UTF32), (UnicodeDecodingResult, UnicodeDecodingResult), (Wrapped?, Wrapped?), (Wrapped?, _OptionalNilComparisonType), ([Key : Value], [Key : Value]), (_OptionalNilComparisonType, Wrapped?), (_UIntBuffer<Element>.Index, _UIntBuffer<Element>.Index), (_ValidUTF8Buffer.Index, _ValidUTF8Buffer.Index)
if g1 == g2 {
^