Skip to content

Parse error when something is not imported #4037

Open
@Boarders

Description

In the following code block:

Id : Set
Id = String

convert :  -> Id -> Expr -> DeBruijn
convert ind id (var x) with id  x
...                       | p = {!p!}

when I split on p I get:

convert :  -> Id -> Expr -> DeBruijn
convert ind id (var x) with id  x
convert ind id (var x) | Relation.Nullary.Dec.yes p = ?
convert ind id (var x) | Relation.Nullary.Dec.no ¬p = ?

along with the error message:

Could not parse the left-hand side
convert ind id (var x) | Relation.Nullary.Dec.yes p
Operators used in the grammar:
  None
when scope checking the left-hand side
convert ind id (var x) | Relation.Nullary.Dec.yes p in the
definition of convert

This is a result of Relation.Nullary not being in scope. I think this error message for a parse error generated by a case split is not ideal and it would be better if it were able to say that the module is not in scope.

Metadata

Assignees

No one assigned

    Labels

    namesscopeIssues relating to scope checkingtype: bugIssues and pull requests about actual bugsux: case splittingIssues relating to the case split ("C-c C-c") commandux: error reportingIssues to do with how Agda reports errorsux: printingIssues relating to how terms are printed for display

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions