Skip to content

4.1 – Autoconformance to synthesized protocols!

Latest
Compare
Choose a tag to compare
@KyLeggiero KyLeggiero released this 06 Jun 23:22
360a35c

Now, lazy containers automatically gain conformance to these protocols when their Value also conforms to them:

  • Equatable
  • Hashable
  • Encodable
  • Decodable

This means that every @Lazy, @ResettableLazy, and @FunctionalLazy field is automatically and transparently made to conform to these just like if they were not lazy!

Important: In order to do this, of course, the value will have to be evaluated. That is, if your @Lazy Hashable field is not yet initialized when you want to get its hash value, then it's automatically initialized first.