-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse Swift SDK.
Issue Description
ParseSwift module is named the same as the ParseSwift class, that makes it impossible to write a fully qualified type in case of the naming conflict. And ParseSwift.Subscription already has a conflict with Combine.Subscription.
Steps to reproduce
This means I cannot even specify EnvironmentObject:
// 'Subscription' is ambiguous for type lookup in this context
// Cannot specialize non-generic type 'Subscription'
@EnvironmentObject var lessons: Subscription<Lesson>
var cancellables = [AnyCancellable]()// 'Subscription' is not a member type of struct 'ParseSwift.ParseSwift'
@EnvironmentObject var lessons: ParseSwift.Subscription<Lesson>
var cancellables = [AnyCancellable]()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 from Combine, and never import Combine when I want to use Subscription. Like this:
typealias MyAnyCancellable = AnyCancellableActual Outcome
Errors
Expected Outcome
No errors
Environment
Client
- Parse Swift SDK version:
4.9.0 - Xcode version:
13.4.1 (13F100)
Logs
n/a
Metadata
Metadata
Assignees
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed