savi-lang / savi

A fast language for programmers who are passionate about their craft.
BSD 3-Clause "New" or "Revised" License
157 stars 12 forks source link

Fix a compat. issue with separate FFI declarations to the same function. #312

Closed jemc closed 2 years ago

jemc commented 2 years ago

When separate FFI declarations to the same function that get compiled into the same program, they are allowed to use different Savi types, as long as they correspond to ABI compatible LLVM types under the hood.

However, in some circumstances, this was causing a compiler crash. Now, as of this change, we do some extra casting in the compiler if needed to account for cases like this in a fairly clean way.