You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SR-1222 A tuple of Equatable types should be Equatable
Issue Description:
this Swift program should work
enum Foo: Equatable { case x(()) }
but
$ swift /tmp/test.swift
/tmp/test.swift:1:6: error: type 'Foo' does not conform to protocol 'Equatable'
enum Foo: Equatable { case x(()) }
^
Swift.==:1:24: note: candidate would match if 'Foo' conformed to 'RawRepresentable'
@inlinable public func == <T>(lhs: T, rhs: T) -> Bool where T : RawRepresentable, T.RawValue : Equatable
^
Swift.FloatingPoint:2:24: note: candidate would match if 'Foo' conformed to 'FloatingPoint'
public static func == (lhs: Self, rhs: Self) -> Bool
^
Swift.BinaryInteger:2:24: note: candidate would match if 'Foo' conformed to 'BinaryInteger'
public static func == <Other>(lhs: Self, rhs: Other) -> Bool where Other : BinaryInteger
^
Swift._Pointer:2:24: note: candidate would match if 'Foo' conformed to '_Pointer'
public static func == (lhs: Self, rhs: Self) -> Bool
^
Swift.Strideable:3:35: note: candidate would match if 'Foo' conformed to 'Strideable'
@inlinable public static func == (x: Self, y: Self) -> Bool
^
Swift.StringProtocol:2:35: note: candidate would match if 'Foo' conformed to 'StringProtocol'
@inlinable public static func == <RHS>(lhs: Self, rhs: RHS) -> Bool where RHS : StringProtocol
^
Swift.SIMD:4:24: note: candidate would match if 'Foo' conformed to 'SIMD'
public static func == (lhs: Self, rhs: Self) -> Bool
^
Swift.Equatable:2:17: note: protocol requires function '==' with type '(Foo, Foo) -> Bool'; do you want to add a stub?
static func == (lhs: Self, rhs: Self) -> Bool
^
problem is that Void isn't Equatable
1> func f<E: Equatable>(_ x: E) {}
2> f(())
error: repl.swift:2:3: error: argument type '()' does not conform to expected type 'Equatable'
f(())
^
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: f24223391d22830b4a28a7f77de8add5
relates to:
Issue Description:
this Swift program should work
but
problem is that
Void
isn'tEquatable
The text was updated successfully, but these errors were encountered: