Skip to content

Syntax-location for error in let body #250

@tnelson

Description

@tnelson

Ideal resolutions of error location for pred vs.let are opposites. Consider this let use from an in-progress model of a kd-tree:

  let d = SearchState.dim | {
    all ch: n.left.*(left+right)  | ch.key[d] < n.key[d]
  ...

If the SearchState.dim expression is ill-typed, a join error is produced. Ideally the error would be reported at the location of the declaration body, not the use site.

However, pred resolution is the opposite: we want to report error location at the use site, not the declaration.

Currently, Forge uses pred style resolution for everything. That was the right call for the majority of errors, but causes confusion for let.

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues related to error messages

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions