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

@Group does not compile if SwiftUI is imported #589

Open
gwynne opened this issue Dec 12, 2023 · 0 comments
Open

@Group does not compile if SwiftUI is imported #589

gwynne opened this issue Dec 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gwynne
Copy link
Member

gwynne commented Dec 12, 2023

In the Ventura SDK, SwiftUI gained a new public struct named Group. As a result, when a file imports both Fluent and SwiftUI and attempts to use Fluent's @Group in a Model, the compiler prefers the SwiftUI definition over the Fluent-provided typealias, despite ample syntactic clues as to which is intended.

Ideally, we would figure out a means to hint to the compiler how to disambiguate without requiring awkward syntax like @FluentKit.GroupProperty<Self, ...>; failing that, try to find a way to at least get the compiler to show a less misleading error message. (Currently the error claims that "Content" cannot be inferred - since Content is a Vapor protocol, this only further obscures the actual problem.)

Note

This is the same kind of name collision as seen in #588. Swift 5.9 seems to be more prone to such collisions than previous versions, as these seem to have been rarely, if ever, encountered in the past despite both collisions having existed for some time.

@gwynne gwynne added the bug Something isn't working label Dec 12, 2023
@gwynne gwynne changed the title @Group does not work properly if SwiftUI is imported @Group does not compile if SwiftUI is imported Dec 12, 2023
@gwynne gwynne self-assigned this Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant