coalton-lang / coalton

Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.
https://coalton-lang.github.io/
MIT License
1.12k stars 67 forks source link

Fix monomorphizer underapplication #1128

Closed kartik-s closed 3 months ago

kartik-s commented 3 months ago

The monomorphizer fails when compiling a COMPILE-CANDIDATE that meets the following criteria:

Such a COMPILE-CANDIDATE could be found, for example, when COALTON-LIBRARY/LIST:MAXIMUM is applied to a (List Big-Float) because COALTON-LIBRARY/LIST:MAXIMUM implicitly underapplies > to Big-Float's instance of Ord, which does not inline the > method.

This PR fixes this case in the monomorphizer, adds a test for it, and adds the monomorphizer tests to the Coalton test suite.

cl-quil/discrete now builds and passes its tests with this (monomorphize) added back.

Izaakwltn commented 3 months ago

Closes #1126