vapor / fluent-kit

Swift ORM (queries, models, and relations) for NoSQL and SQL databases
MIT License
217 stars 116 forks source link

@Group does not compile if SwiftUI is imported #589

Open gwynne opened 11 months ago

gwynne commented 11 months ago

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.