This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The equality operator `==` is really strict with unions and intersections, | |
-- where the order of their components needs to be the same. | |
type function sort_type(input: type) | |
local input_tag = input.tag | |
if input_tag == "union" or input_tag == "intersection" then | |
local components = input:components() | |
table.sort(components, function(a: type, b: type): boolean | |
local a_tag, b_tag = a.tag, b.tag |
OlderNewer