Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BREAKPOINT crash when using ReplaceError parser #328

Open
russellyeo opened this issue Dec 3, 2023 · 0 comments
Open

EXC_BREAKPOINT crash when using ReplaceError parser #328

russellyeo opened this issue Dec 3, 2023 · 0 comments

Comments

@russellyeo
Copy link

I have encountered a crash when using replaceError(with:), and can reproduce it using the example documented in the OneOf parser.

enum Currency { case eur, gbp, usd, unknown }

let currency = OneOf {
    "".map { Currency.eur }
    "£".map { Currency.gbp }
    "$".map { Currency.usd }
}
.replaceError(with: Currency.unknown)

print(currency.parse("$")) // Currency.usd
print(currency.parse("฿")) // Thread 1: EXC_BREAKPOINT (code=1, subcode=0x100004650)

Using a SPM executable package on Xcode 15.0.1 (15A507)

I tried stepping through the library code to try see if I could find the root cause, but I think it is beyond my ability/understanding!

Thanks,
Russell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant