Skip to content

Syntax error compiling CasePath expression with '/' in Swift 5.7 #74

Closed
@andreyz

Description

@andreyz

image

Seems like it's colliding with RegEx literal syntax. Any recommended workarounds? @stephencelis demonstrates use of initialiser here in Swift Forums:

-.pullback(state: \Struct.property, action: /Enum.case)
+.pullback(state: \Struct.property, action: CasePath(Enum.case))

Here's another workaround, based off Revised RegEx parsing behaviour:

-(\HomeState.route).appending(path: /HomeRoute.game).extract(from:)
+(\HomeState.route).appending(path: (/HomeRoute.game)).extract(from:)

Related discussion was in #72

PS Seems like neither workarounds are making Xcode 14 previews happy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apple bugSomething isn't working due to a bug on Apple's platforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions