Closed
Description
Previous ID | SR-13148 |
Radar | rdar://problem/65116465 |
Original Reporter | @typesanitizer |
Type | Improvement |
Status | Closed |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | Compiler |
Labels | Improvement, DiagnosticsQoI, TypeChecker |
Assignee | @theblixguy |
Priority | Medium |
md5: 4bb991b5e9e2dccaaee344947a743120
Issue Description:
struct S : Comparable { // error: type 'S' does not conform to protocol 'Comparable'
var x: Int
}
Maybe it should look something like (straw-man suggestion):
synthesizing Comparable conformances is not supported for structs
Bit of a tangent but... this limitation is just plain weird, given that we support Comparable derivation for enums with associated fields:
enum E : Comparable {
case e(Int, Int) // Just Works
}
Should one use single-case enums instead of structgs to get the sweet, sweet conformance synthesis? �