-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It should be possible to coerce multiple complex types to find a common maximum type they can all be instances of (with / without promotion), this can get complicated considering the absence of an attribute of a complex type is permissible when the value is null.
For example, assume the user defines an array of complex literals like the following:
[ {X = 42, Y = 5.0, Z = 'bla'}, {X = 50.0, Y = 4.3}, {W = 'a'} ]
The maximum type that all of the above instances can be mapped to requires visiting all of the instances to figure that out.
Struct <> {
X float;
Y float;
Z string;
W string;
}
we could do this by calculating the maximum type via:
Line 525 in 98d988c
static Type maximumType(@Nonnull final Type t1, @Nonnull final Type t2) { |
maximumType(
maximumType(
ToCascadesType("{X = 42, Y = 5.0, Z = 'bla'}"),
ToCascadesType("{X = 50.0, Y = 4.3}"),
ToCascadesType("{W = 'a'}"))
But this requires adding the capability of calculating the maximum type of a structured type to Type.maximumType
which we do not have at the moment.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request