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 compiler crash related to reachability of `<:` type expressions. #301

Closed jemc closed 2 years ago

jemc commented 2 years ago

This bug was causing Equatable(Any'non) to be considered reachable when Array(Any'non).includes was called, causing a crash due to non not being a valid partial reification of the type param of Equatable.

It was being considered reachable because of the A <: Equatable(A)'read check that happens inside the includes method, which was treating the hypothetical type Equatable(Any'non)'read as being reachable despite not being valid.

The issue was fixed by not treating any pure type expressions as reachable. Only the types of values are reachable, but not type expressions.