Skip to content

How to let third-party enum confirm CasePathable #144

Answered by stephencelis
marcuswu0814 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @marcuswu0814! It's not possible to apply a macro to define such a conformance, but it is possible to define it from scratch for types you don't own. For example, the library defines CasePathable conformances for the Optional and Result types: https://github.com/pointfreeco/swift-case-paths/blob/main/Sources/CasePaths/Result%2BCasePathable.swift

We also define a bunch of manual conformances in the Composable Architecture.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcuswu0814
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants