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

Suggest renaming SwiftDate struct to SwiftDateConfig or similar to disambiguate module from struct #814

Open
mitchins opened this issue May 26, 2023 · 0 comments

Comments

@mitchins
Copy link

mitchins commented May 26, 2023

As per the Xcode warning:

Public struct 'SwiftDate.SwiftDate' shadows module 'SwiftDate', which may cause failures when importing 'SwiftDate' or its clients in some configurations; please rename either the struct 'SwiftDate.SwiftDate' or the module 'SwiftDate', or see https://github.com/apple/swift/issues/56573 for workarounds

When compiling from source, it generally may not cause an issue, but when trying to distribute the module as a pre-compiled .xcframework, it will cause issues in the import.

It seems like a mostly cosmetic thing, but having a class or struct the same name as a module can cause issues like this, so it would seem best to avoid it by choosing another name like SwiftDateConfig or anything really.

I'd be happy to do the work if it's blessed and there's a name that's chosen.

Having done a quick check in the 6.3.1 release (due to iOS 12 constraints currently) it seems fairly sane.

image

Additionally
SwiftDate.defaultRegion -> SwiftDateConfig.defaultRegion
SwiftDate.autoFormats -> SwiftDateConfig.autoFormats

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