Skip to content

Conversation

liamnichols
Copy link
Contributor

Background

When implementing the new @UserDefaultOverride property wrapper, I ran into the following compile issue:

Screenshot 2022-01-14 at 18 34 48

Even if an optional type, we should still be able to provide a non-nil default value.

Description

This was a mistake on my initial implementation in #8 that I didn't spot. The fix however was simple since I just had to add the wrappedValue argument on the initialiser and set its default value to nil.

@liamnichols liamnichols requested a review from ryanpato January 14, 2022 17:46
@liamnichols liamnichols self-assigned this Jan 14, 2022
@liamnichols liamnichols merged commit 0368d8b into main Jan 17, 2022
@liamnichols liamnichols deleted the ln/user-default-override-optional-default branch January 17, 2022 09:34
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

Successfully merging this pull request may close these issues.

2 participants