Tuesday, August 22, 2017

Swift 4: Synthesizing Equatable and Hashable Conformance

SE-0185:

Developers have to write large amounts of boilerplate code to support equatability and hashability of complex types. This proposal offers a way for the compiler to automatically synthesize conformance to Equatable and Hashable to reduce this boilerplate, in a subset of scenarios where generating the correct implementation is known to be possible.

Terrific.

3 Comments RSS · Twitter

Maybe next they can get rid of "func" and "var", and change "let" to const. And switch the order of the type definitions (its backwards). Then Swift will be an ok language to write in. Still not as good as Objective-C of course, but that's a good start.

[…] Swift’s Error Handling Implementation, Swift 4: Bridging Peephole for “as” Casts, Swift 4: Synthesizing Equatable and Hashable Conformance, Swift 4: JSON With Encoder and Encodable, Swift 4 String Manifesto, Provide Custom Collections for […]

[…] Swift 4: Synthesizing Equatable and Hashable Conformance, Swift 4.1 Conditional Conformance Is Amazing, Code Size Optimization Mode in Swift […]

Leave a Comment