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

Migrate from as! to guard let else fatalError(…) construct #6

Closed
AliSoftware opened this issue Jan 31, 2016 · 0 comments
Closed

Migrate from as! to guard let else fatalError(…) construct #6

AliSoftware opened this issue Jan 31, 2016 · 0 comments

Comments

@AliSoftware
Copy link
Owner

I tend to avoid the use of force-unwrapping ! and force-casting as!.

I think it's preferable to use guard let x = y as? Y else { fatalError("…") } and use an explicit and helpful error in the fatalError(…) call rather than let x = y as! Y

There are not many force-casts in the codebase so that should be pretty quick to do.

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