Closed ulitiy closed 2 years ago
What exactly are you trying to do? For example what code isn’t compiling and how does it differ from the many tests in the test suite? Heres an example using combine: https://github.com/parse-community/Parse-Swift/blob/a143c0f9786e4d605d3506caa8e624272892af6a/Tests/ParseSwiftTests/ParseLiveQueryCombineTests.swift#L43-L69
Another using Subscription: https://github.com/netreconlab/SnapCat/blob/66bd9a2cecd4e665bc7bca13ce74690d2c613bb2/SnapCat/CustomViewModels/QueryImageViewModel.swift#L14-L340
I was trying to use an EnvironmentObject
with a Subscription<Lesson>
class to reuse the subscription in multiple nested components. It's impossible if Combine
is imported because there's Combine.Subscription
.
It fails anyways even if I use MyAnyCancellable
with No ObservableObject of type Subscription<Lesson> found.
somehow.
In your examples you do not use EnvironmentObject
with Combine
imported at the same time.
Anyways there's a reason why there's no Swift.Swift
class (or similar) in the standard libraries – because there would be no way to call Swift.String
not causing the error. I understand that many of the libraries conform to the same convention as ParseSwift but it's causing problems, lots of unresolved discussions: https://www.google.com/search?q=swift+module+and+class+name+collision
Thanks for reporting and describing your issue. The linked PR should address the problem
Thank you for the quick response and for working on the library!
New Issue Checklist
Issue Description
ParseSwift
module is named the same as theParseSwift
class, that makes it impossible to write a fully qualified type in case of the naming conflict. AndParseSwift.Subscription
already has a conflict withCombine.Subscription
.Steps to reproduce
This means I cannot even specify
EnvironmentObject
:If the module name was different from the class name it could be possible to have Maybe another option is to have typealiases for conflicting names but it doesn't resolve conflicts with local project names.
AFAIK there's no tool like
::
in Swift. The only way I see it can be fixed now by the library user is by importing and aliasing specific types fromCombine
, and never importCombine
when I want to useSubscription
. Like this:Actual Outcome
Errors
Expected Outcome
No errors
Environment
Client
4.9.0
13.4.1 (13F100)
Logs
n/a