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.)
Due to the
CustomStringConvertible
conformance provided byAnyModel
, the rules of dynamic dispatch through existentials, and the behavior ofMirror
, Fluent malfunctions badly if a model tries to provide an optionaldescription
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 theCustomStringConvertible
conformance fromAnyModel
. Look into whether sneaking around the problem using something like the@_implements
attribute would work.)