[GHC] #13305: static: check for identifiers should only consider term level variables

GHC ghc-devs at haskell.org
Fri Feb 24 18:43:55 UTC 2017


#13305: static: check for identifiers should only consider term level variables
-------------------------------------+-------------------------------------
        Reporter:  edsko             |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:  worksforme        |             Keywords:
                                     |  StaticPointers
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by facundo.dominguez):

 > Why does it make a difference whether g is inlined or not?

 The crucial difference between type-checking a local `g` and type-checking
 the body of the static form, is that `g` has the context of the enclosing
 function available, whereas the body of the static form does not.

 Therefore, inlining has the effect of removing the constraints of the
 enclosing function, and in return, it allows types to be non-closed.

 > Do each one of the examples I write at the top of this comment
 pass/don't pass as expected in GHC HEAD?

 I only see one example. And yes, it does pass.

 > If so, which commit changed that in HEAD and where these changes
 intentional?

 The commit which allows closed variables in static forms:
 http://git.haskell.org/ghc.git/commit/36d29f7ce332a2b1fbc36de831b0eef7a6405555

 The relevant bit of the commit message reads
 {{{
 The renamer does not check anymore if free variables appearing in the
 static form are top-level. Instead, the typechecker looks at the
 tct_closed flag to decide if the free variables are closed.
 }}}

 > and where these changes intentional?

 I don't remember being aware of this aspect before.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13305#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list