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

Fluent Models malfunction if given a property named description #588

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

Fluent Models malfunction if given a property named description #588

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

Comments

@gwynne
Copy link
Member

gwynne commented Dec 7, 2023

Due to the CustomStringConvertible conformance provided by AnyModel, the rules of dynamic dispatch through existentials, and the behavior of Mirror, Fluent malfunctions badly if a model tries to provide an optional description property as a database field. There is no warning from the compiler or the framework for this scenario and no indication whatsoever of the underlying cause. Fluent needs to either trigger an assertion as easily as possible for such properties, or - much more preferably - handle them gracefully. (Note: The latter is badly complicated by the fact that it would be a semver-major break to remove the CustomStringConvertible conformance from AnyModel. Look into whether sneaking around the problem using something like the @_implements attribute would work.)

@gwynne gwynne added the bug Something isn't working label Dec 7, 2023
@gwynne gwynne self-assigned this Dec 7, 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