-
-
Notifications
You must be signed in to change notification settings - Fork 82
updating error type to use computed properties #559
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
base: main
Are you sure you want to change the base?
Conversation
Edit: Nevermind, I should've clicked through to the PR you linked before asking 😅. |
Heh - the tl;dr for anyone looking: Cory said it much better than I would:
|
As for the "why did I pick this particular thing to poke at?" - I'm referencing this type in some internal documentation as an example of a good way to wrangle Error types. Other examples got the above treatment, and I wanted to both have the code I'm referencing actually match what's in this project while also reflecting consistency among the examples I choose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heckj sorry for taking so long to come back to you!
@usableFromInline | ||
let base: Base | ||
|
||
@inlinable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this one now marked as @inlinable
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't need to be, I was cargo-culting the pattern I saw in apple/swift-nio#3229, which added @inlinable
to the initializers as well. I presumed that was helping with performance effects from inlining in that code, but I'm replicating that somewhat blindly.
Happy to pull it back out.
Small updates to convert this error type to using computed properties instead of static properties, following the pattern at apple/swift-nio#3229