Opened 3 years ago

Closed 3 years ago

#10446 closed bug (fixed)

Fix error message when variables in a static form are not in scope

Reported by: facundo.dominguez Owned by: facundo.dominguez
Priority: normal Milestone: 7.10.2
Component: Compiler Version: 7.10.1
Keywords: StaticPointers Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D906
Wiki Page:

Description

If an identifier is out-of-scope but inside a static form (static f) then GHC says expression not closed, when really it should just say identifier out of scope.

t.hs:6:5: error:
    Only identifiers of top-level bindings can appear in the body of the static form:
      static f
    but the following identifiers were found instead:
      f

We just want:

t.hs:6:12: error: Not in scope: ‘f’

Change History (4)

comment:1 Changed 3 years ago by facundo.dominguez

Differential Rev(s): Phab: D906
Status: newpatch

comment:2 Changed 3 years ago by facundo.dominguez

Differential Rev(s): Phab: D906Phab:D906

comment:3 Changed 3 years ago by Austin Seipp <austin@…>

In 71d1f01db94dda5b8c2c367fba8cc7b115b06e95/ghc:

Omit the static form error for variables not in scope.

Summary:
Fixes T10446.

The following program

> g = static f

now produces only:

> ...: error
>    Not in scope: 'f'

Before it would also produce a complaint about 'f' not being a top-level
identifier.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: bgamari, thomie, mboes

Differential Revision: https://phabricator.haskell.org/D906

GHC Trac Issues: #10446

comment:4 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.