[GHC] #12003: Improve error message about closed variables
GHC
ghc-devs at haskell.org
Mon May 2 19:06:58 UTC 2016
#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
More information about the ghc-tickets
mailing list