CasePaths subscript not working on Swift 6 #203
Replies: 3 comments
-
Hi @gianfilippocisternino, can you please provide a minimal reproduction of the problem? |
Beta Was this translation helpful? Give feedback.
-
Hi @mbrandonw, i uploaded a sample app that shows the problem. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hi @gianfilippocisternino, this just seems like a regression in the Swift compiler in Swift 6. If you add some explicit type annotations it works just fine: get: { [unowned self] () -> Value? in
…
return navigationPath[topMainDestination]?.compactMap { destination -> Value? in 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.
-
Compiler is giving unexpected errors when using
CasePath
subscript on Swift 6. This error happens only in some cases (see snippet below).While looking for a potential bug i found this commented code: e39069d
May that fix the issue?
This snippet compiles fine:
This one triggers an error somewhere else in the function:
Example
CasePathsDemo.zip
Environment
Beta Was this translation helpful? Give feedback.
All reactions