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

Warnings when compiled with Xcode 14.3 RC #595

Closed
bealex opened this issue Mar 22, 2023 · 6 comments
Closed

Warnings when compiled with Xcode 14.3 RC #595

bealex opened this issue Mar 22, 2023 · 6 comments

Comments

@bealex
Copy link

bealex commented Mar 22, 2023

There are several warnings appeared if compile with Xcode 14.3. Can you please fix them? Here is the log from the build:

.../mixpanel-swift/Sources/Network.swift:144:54: warning: heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional
        let requestData = JSONHandler.encodeAPIData([["event": eventName, "properties": trackProperties]])
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                         as [String : Any]
.../mixpanel-swift/Sources/Network.swift:182:57: warning: heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional
            let engageData = JSONHandler.encodeAPIData([["$token": apiToken, "$distinct_id": distinctId, "$add": [eventName: 1]]])
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                 as [String : Any]
.../mixpanel-swift/Sources/People.swift:269:43: warning: empty collection literal requires an explicit type
        set(properties: ["$transactions": []])
                                          ^~

.../mixpanel-swift/Sources/SessionMetadata.swift:34:52: warning: heterogeneous collection literal could only be inferred to '[String : Any]'; add explicit type annotation if this is intentional
        let dict: [String: Any] = ["$mp_metadata": ["$mp_event_id": String.randomId(),
                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@RamblinWreck77
Copy link
Contributor

I don't see any warnings on xcode 14.3/mixpanel 4.1/4.1.1 and using SPM.

How are you integrating?

@bealex
Copy link
Author

bealex commented Apr 29, 2023

As the SPM package. 4.0.4 was imported, I've updated to 4.1.1 but nothing's changed. Here is the discussion about this warning.

https://forums.swift.org/t/swift-5-8-new-warnings-for-any-collections/63484/10
and
swiftlang/swift#60011

@xmanu
Copy link

xmanu commented May 16, 2023

Is there any progress on this? I see the same warnings and I'd love to have these fixed...

@RamblinWreck77
Copy link
Contributor

#602

@jaredmixpanel
Copy link
Contributor

@xmanu I will get a release out today with #602 in it

@jaredmixpanel
Copy link
Contributor

Fixed in v4.1.2

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

4 participants