Skip to content

Getter for 'subscript(dynamicMember:)' is unavailable Xcode16 #3158

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

You must be logged in to vote

@yliu342 Swift 6 has gotten a bit more strict with availability checks, which is a good thing. In your code sample Swift 5 was actually compiling some invalid code that may have only incidentally functioned. You can update your reducer with nested scoping to fix:

Scope(state: \.contentState, action: \.self) {
  Scope(state: \.login, action: \.login) {
    Login()
  }
  
  Scope(state: \.main, action: \.main) {
    Tabs()
  }
}

You may want to choose to refactor the contentState enum to its own reducer, though.

Replies: 3 comments 16 replies

Comment options

You must be logged in to vote
6 replies
@yliu342
Comment options

@Narsail
Comment options

@stephencelis
Comment options

Answer selected by yliu342
@yliu342
Comment options

@jaganrajj19
Comment options

@mbrandonw
Comment options

Comment options

You must be logged in to vote
8 replies
@Alex293
Comment options

@stephencelis
Comment options

@Alex293
Comment options

@Narsail
Comment options

@Alex293
Comment options

Comment options

You must be logged in to vote
2 replies
@stephencelis
Comment options

@chwo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants