Preemptively add "number" as a kind of flexible variable that can unify with an (Is Number)
This is similar to the recent issue with comparable brought up by Max.
commit47aa48d9fdd0b9b618f6975997c594287b86c26d
authorEvan Czaplicki <info@elm-lang.org>
dateSat 10 Aug 2013, 14:26 (13 years ago)
parent1e0294e
compiler/Type/Unify.hs+1−1
@@ -77,7 +77,7 @@ actuallyUnify span variable1 variable2 = do
7777 unify' variable1 variable2
7878
7979 unifyNumber svar name
80− | name `elem` ["Int","Float"] = flexAndUnify svar
80+ | name `elem` ["Int","Float","number"] = flexAndUnify svar
8181 | otherwise = TS.addError span "Expecting a number (Int or Float)" variable1 variable2
8282
8383 comparableError str = TS.addError span (str ++ msg) variable1 variable2