savi-lang / savi

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

Fix a compiler crash related to type aliases. #271

Closed jemc closed 2 years ago

jemc commented 2 years ago

Compiler code related to finding type arguments associated with a generic type was breaking when the type arguments were hidden behind a type alias.

The right fix would be to dig through arbitrary layers of type aliases to find the appropriate type argument source location, but this fix takes the lazy way out and just makes the compiler error messages slightly less useful in this case by not having the source location of the type argument (but still showing enough information to understand the issue and debug the problem).

Maybe we'll fix this in a nicer way after the later overhaul of type inference and type checking.