Closed hank121314 closed 1 year ago
In order to let Defaults.Key.init support @_alwaysEmitIntoClient,
Why does Defaults.Key.init
need to support @_alwaysEmitIntoClient
?
Why does Defaults.Key.init need to support @_alwaysEmitIntoClient?
With @_alwaysEmitIntoClient
, it will let runtime warning appear at call site.
Here is the screenshot if not using @_alwaysEmitIntoClient
:
Nice work 👍
Summary
This PR fixes: #120
Implement Xcode runtime warning in
Defaults
. In order to letDefaults.Key.init
support@_alwaysEmitIntoClient
, there is a needed to mark some functions/properties as@usableFromInline
. And I also explicit theinternal
keyword for these functions/properties(To remind the developer not to change the access level).Validate the default key name and if it is wrong, emit with Xcode runtime warning.
Screenshot
Thanks
Thanks for your code review 😄 !