[GHC] #16346: Lint error on master: Occurrence is GlobalId, but binding is LocalId
GHC
ghc-devs at haskell.org
Wed Feb 20 14:37:03 UTC 2019
#16346: Lint error on master: Occurrence is GlobalId, but binding is LocalId
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.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):
Yes I think so. But the real issue is this in
`SimplEnv.refineFromInScope`:
{{{
refineFromInScope :: InScopeSet -> Var -> Var
refineFromInScope in_scope v
| isLocalId v = case lookupInScope in_scope v of
Just v' -> v'
Nothing -> WARN( True, ppr v ) v -- This is an error!
| otherwise = v
}}}
Notice that we don't look `GlobalId`s up in the in-scope set. Yet that is
the mechanism that ensures that in a situation like
{{{
let f_2dr[LclId] = blah in ...M.f_2df[GblId]...
}}}
(which has a local binding for a `GlobalId`), we transform to
{{{
let f_2dr[LclId] = blah in ...f_2df[LclId]...
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16346#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list