the.bay.news

`warns` as a non-returning `throws`

Swift Forums
`warns` as a non-returning `throws`
Sometimes, even when I can recover and continue, I'd like to bubble some message back up about what the hiccup was and how I fixed it. One solution for this would be a new warns keyword which works much like throws, except it doesn't return. Take func parse(_ source: String) throws -> AST, for example, which would parse the given Swift up to an Abstract Syntax Tree. Let's say it runs into a small issue, an implicit cast to Any, let's say. Our parser is smart enough to fix the issue on its own, b...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.