ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
403 stars 40 forks source link

Move generic inference from FunctionCall, clean it up, make it recursive and use findCommonRoot on all candidates to get the final type. #945

Open alexnask opened 8 years ago

alexnask commented 8 years ago

Right now, it really just is a series of hacks for specific cases.

I think we should split it out in algo/genericInference (or something similar), with the following API:

Where a refType is a type the typeArg appears in unspecialized (for a function, it is the signature type), while a type is the corresponding type with the specialized typeArg.