How to do a typesystem workaround ...

Dear specialists,

the following code snip leads to a typesystem error in the closure inside the sortBy():
type meet (datetime & void) is not a subtype of java.lang.Comparable


sequence<Order> best = new sequence<Order>(empty);
best = best.sortBy({~it => it.orderDate; }, asc);

orderDate is of type "datetime" implemented in the dates language. But datetime is a simple concept derived from Type - so indeed it does not implement the java.comparable interface.

How can i get rid of the typesystem error message. I already tried to write a new inference rule in my language for SortOperation ("sortBy") with overrides set to "true". But that does not override the original rule.

Any other possibilities ?

Best,
Dan

Please sign in to leave a comment.