rql #83202 Typing OR clauses not as expected [open]
generic_rel is quite generic a relation which can link a CWUser for example to pretty anything ( '*' in the schema). The problematic RQL request looks like
SET U generic_rel X WHERE ... , A rel1 X OR B rel2 X
where the ... introduces the A and B variables and the rel1 and rel2 relations actually have distinct objet types.
The error raised is
TypeResolverException: Unable to resolve variables types in [...]
The point is that the type system associate one type variable to the X symbol, thus leading to a unification error. Said otherwise, the algorithm does not introduce union/sum types.
I would have expected the following semantics
SET U generic_rel X0 WHERE ... , A rel1 X1 OR B rel2 X2
With X1 typed T1 according to rel1, X2 T2 according to rel2 and X0 as (T1 | T2).
Or in an equivalent way
SET U generic_rel X1 WHERE ... , A rel1 X1 SET U generic_rel X2 WHERE ... , B rel2 X2
NB: This is an "unexpected behaviour" kind of report. It is yet undecided whether this should become an improvement ticket for RQL capabilities or for the documentation of its desired limitations.
|appeared in||<not specified>|
|done in||<not specified>|
|closed by||<not specified>|