Skip to content

update infer to track expected/span for better error messages #3197

Closed
@nikomatsakis

Description

@nikomatsakis

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 call contratys() or contraregions().

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions