update infer to track expected/span for better error messages #3197
Labels
A-type-system
Area: Type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Right now, when processing a constraint (like
T1 <: T2
), infer does not track any sort of location information. It should be given a span and a boolean indicating which type (the super of sub type) should be referred to as the "expected type". This boolean value will be switch when we callcontratys()
orcontraregions()
.These changes would enable better error messages. We could get the "expected foo, found bar" messages more accurate, and we would be able to pass better spans into the (yet to be landed, as of this writing) new region inference, which could then describe more accurately to the user where conflicting constraints originate from.
The text was updated successfully, but these errors were encountered: