Key path cannot refer to static member '....' Error #3042
Replies: 1 comment 1 reply
-
@artemkrachulov Case key path syntax only works with enums that have the So you need to add those to your enum and it should work: struct StructB {
var content: Content
+ @CasePathable
+ @dynamicMemberLookup
@ObservableState
public enum Content {
case contentA(ContentAReducer.State)
}
} Note that See the documentation for more info: https://pointfreeco.github.io/swift-composable-architecture/main/documentation/composablearchitecture/reducers#CasePathable-and-dynamicMemberLookup-enums Since this isn't a bug in the library I'm going to convert to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Description
When I tried to leverage all new features of version 1.7, I faced an error with observing case the path for the nested state. Accessing the case path scoping store shows:
Key path cannot refer to static member '....'
.Here is example implemented in both versions:
Checklist
main
branch of this package.Expected behavior
No response
Actual behavior
No response
Steps to reproduce
No response
The Composable Architecture version information
1.10.2
Destination operating system
iOS15
Xcode version information
Version 15.2 (15C500b)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions