[GHC] #15211: exprFreeVars does not include type variables

#15211: exprFreeVars does not include type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The `exprFreeVars` function returns the free variables of an expression. However, this function doesn't include the type variables free in the free term variables. This might be OK for some uses, but it seems ''not'' OK if we use the result of `exprFreeVars` in an `InScopeSet`, which is done in many places. I don't have a program that exhibits misbehavior, but I feel fairly sure that we have a problem here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15211 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15211: exprFreeVars does not include type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: 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 simonpj):
However, this function doesn't include the type variables free in the free term variables
That would indeed seem wrong. I think you are suggesting that a `closeOverKinds`-style thing is needed? If so, then in `CoreFVs.expr_fvs` {{{ expr_fvs (Type ty) fv_cand in_scope acc = tyCoFVsOfType ty fv_cand in_scope acc }}} we would ''not'' want to use a version of `tyCoFVsOfType` that closed over the kinds. (We'll do that at the end; and it's wrong to do so at the occurrences. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15211#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15211: exprFreeVars does not include type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: 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 goldfire): Yes, that's right. We'd have to export the non-closed traversals so that we can extend the traversal to terms. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15211#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC