[GHC] #12003: Improve error message about closed variables
#12003: Improve error message about closed variables -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple StaticPointers | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #11656 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- After allowing local bindings in static definitions the following program {{{ {-# LANGUAGE StaticPointers #-} module M where f x = static g where g = h h = x }}} yields the error {{{ ../tmp/M.hs:4:7: error: • ‘g’ is used in a static form but it is not closed. • In the expression: static g In an equation for ‘f’: f x = static g where g = h h = x }}} Where it would be more helpful to get a message like {{{ ../tmp/M.hs:4:7: error: • ‘g’ is used in a static form but it is not closed because it uses ‘h’ which uses ‘x’ which is not let-bound. • In the expression: static g In an equation for ‘f’: f x = static g where g = h h = x }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12003> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12003: Improve error message about closed variables -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | StaticPointers Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11656 | Differential Rev(s): Phab:D2167 Wiki Page: | -------------------------------------+------------------------------------- Changes (by facundo.dominguez): * status: new => patch * differential: => Phab:D2167 @@ -23,1 +23,1 @@ - Where it would be more helpful to get a message like + where it would be more helpful to get a message like New description: After allowing local bindings in static definitions the following program {{{ {-# LANGUAGE StaticPointers #-} module M where f x = static g where g = h h = x }}} yields the error {{{ ../tmp/M.hs:4:7: error: • ‘g’ is used in a static form but it is not closed. • In the expression: static g In an equation for ‘f’: f x = static g where g = h h = x }}} where it would be more helpful to get a message like {{{ ../tmp/M.hs:4:7: error: • ‘g’ is used in a static form but it is not closed because it uses ‘h’ which uses ‘x’ which is not let-bound. • In the expression: static g In an equation for ‘f’: f x = static g where g = h h = x }}} -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12003#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12003: Improve error message about closed variables -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | StaticPointers Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11656 | Differential Rev(s): Phab:D2167 Wiki Page: | -------------------------------------+------------------------------------- Changes (by facundo.dominguez): * cc: mboes (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12003#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12003: Improve error message about closed variables -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: | StaticPointers Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11656 | Differential Rev(s): Phab:D2167 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"e9dfb6e51f0cd585611a742ce7167e307ee7e7e8/ghc" e9dfb6e/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e9dfb6e51f0cd585611a742ce7167e307ee7e7e8" Improve the error messages for static forms. Now the message explains why closed variables are not closed when encountered in the body of (static ...). This required adding to the local environment the free variables of the local bindings in scope. Thus we can analyze and explain why a variable is not closed when encountered. Test Plan: ./validate Reviewers: austin, simonpj, bgamari Reviewed By: bgamari Subscribers: mboes, thomie Differential Revision: https://phabricator.haskell.org/D2167 GHC Trac Issues: #12003 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12003#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12003: Improve error message about closed variables -------------------------------------+------------------------------------- Reporter: | Owner: facundo.dominguez | Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: | StaticPointers Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11656 | Differential Rev(s): Phab:D2167 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.2.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12003#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC