Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Expand type constraints allowed in datatype() #5774
You can declare type-checked fields with an Exactly constraint on a specific type (so checking
Datatype fields no longer just have to match field types exactly -- they can now just be restricted to e.g. any subclass of some given class or mixin (with e.g.
left a comment
The one thought this patch brings up for me is that subclass type constraints aren't allowed in the engine right now. In some places that's explicit and in others it's implicit. Now that we can add type constraints to datatypes fields, it might make sense to think about bounding those field type constraints for types used in the engine.
I don't know what the right approach for that is though, and it's not directly related to this.