Skip to content

1.4.0

Compare
Choose a tag to compare
@stephencelis stephencelis released this 06 Jun 15:26
· 41 commits to main since this release

What's Changed

  • Added: A @CasePathable instance can now be used to look up its associated case path (#158).

    @CasePathable
    enum Foo {
      case bar(Int)
      case baz(String)
    }
    
    let baz = Foo.baz("Blob")
    let bazCase = Foo.allCasePaths[baz]  // PartialCaseKeyPath<Foo>
    baz.is(bazCase)  // true
  • Added: A @CasePathable enum can now iterate over all of its case key paths (#159).

    @CasePathable
    enum Foo {
      case bar(Int)
      case baz(String)
    }
    
    let baz = Foo.baz("Blob")
    for casePath in Foo.allCasePaths {
      print(baz.is(casePath))
    }
    // false
    // true
    let casePaths = Array(Foo.allCasePaths)  // [PartialCaseKeyPath<Foo>]
    casePaths == [\.bar, \.baz]  // true
  • Infrastructure: Strict concurrency has been enabled in preparation for Swift 6 (#156).

Full Changelog: 1.3.3...1.4.0