Replies: 2 comments
-
Hi @Kyome22, this unfortunately seems like a crash in the compiler and not related to TCA. Here is a simpler reproduction: @CasePathable enum Action { case result(Result<(Int, Int), Never>) }
func foo<A>(casePath: CaseKeyPath<Action, A>) {}
func bar() {
foo(casePath: \.result.success) // 🛑
foo(casePath: \.result.failure) // 🛑
} It works fine when the tuple is replaced with a non-tuple. I recommend bundling the data of your tuple up into a proper struct, and then it will work fine. Since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Kyome22 If you open an issue on the Swift repo please share here! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
If the
enum
defined with associated values and its value type isResult
with a success value of tuple, compiling a receiving action using case key paths will fail.(Even if I implement it as written in Migrating 1.4, the build will fail, and the cause will not be clearly displayed in the log.)
Checklist
main
branch of this package.Expected behavior
Compilation successes.
Actual behavior
Compilation fails.
Reproducing project
If you use a struct instead of a tuple, it will compile.
The Composable Architecture version information
1.17.0
Destination operating system
iOS 18
Xcode version information
Version 16.2 (16C5032a)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions