RX0245

Domain: Execution

Error message

sort orders a list, and %s is a map (%s)

In the message, %s marks a value that the engine fills in when it raises the error.

The story

You called sort on a map, and rush told you sort orders lists. Let's see the reasoning. A list has positions, so sorting it just rearranges them. A map is different: its members are found by key, not by position, so there is no order to put back. And there is a real question hiding here. Do you want the keys sorted, or the values? Rush will not guess, because a wrong guess looks exactly like a right answer. So it refuses, naming the holder you passed. Imagine a map of scores by player name. If you want the players in alphabetical order, you write sort of keys of the map. If you want the scores from lowest to highest, you write sort of values of the map. And if you have a list of maps, say one record per player, sort can order them by a label, using the by argument. The message's second slot repeats those fixes. Choose the face you actually want, and sort will do the rest.

Text from the Rush engine's error catalogue.