Open ended type system #61
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 4 hours 50 minutes
Due date
c.fahner
4 hours 50 minutes
No due date set.
Blocks
#60 Remove StorageClass and type checking predicates
slendium/ocd
Reference
slendium/ocd#61
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the type system only allows types that reduce to one of the types described by the
StorageClassenum. This is quite an inflexible system and has the potential to break any time a type must be added. It's also bad at denoting hierarchies.The
Type::serialize()method should be changed to allow amixedreturn type, and theTypeInfoutility should only report types that are notmixed,nullor DNF. Meaning thatTypeimplementations must still explicitly override the return type hint of theserialize()method. TheStorageClassenum should also be removed (see #60).Additionally the
Updatestatements that deal with adding/setting data must be changed to allowmixed.Implementations may reject types they don't recognize, but for conformance they must pass the "basic types" test (tracked via slendium/ocd-conformance-tests#6). The basic types to support would be
DateTimeInterface,BackedEnum,Blob,array(to enable compound types stored as JSON in SQL databases),string,float,intandbool.For the
DateTimeInterfacespecifically, support must be added to the relevantPredicate\Exprtypes that deal with equality/comparison. ThePredicate\DocumentShapeutility must be expanded with the following methods (which should also be documented at the top of the class):before(DateTimeInterface)onOrBefore(DateTimeInterface)after(DateTimeInterface)onOrAfter(DateTimeInterface)Issues #37 and #4 are now obsolete.
Update 2026-09-20: Provide type implementations for the missing basic types: enumerations, date/times and arrays (which will default to generic maps).