[GHC] #10782: Existential variables not scoped?

#10782: Existential variables not scoped? -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- I was looking into scoping of type variables, and it looks to me that type-checking the introduction of existentials (that is, checking a GADT pattern-match) doesn't extend the type environment. I doubt there's any way to tickle this bug. But the existential skolems don't seem to be added to the `tcl_tyvars` field of the `TcLclEnv`, which means that inner quantification, should uniques collide(!), might do the wrong thing in `quantifyTyVars`. To be clear, I don't wish the variables actually to scope in Haskell source, just for GHC to remember that the internal variables are in scope, to return from `tcGetGlobalTyVars`. Is my analysis wrong somewhere? Do we just assume that uniques being unique will take care of this? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10782 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10782: Existential variables not scoped? -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Can you give an example of some kind? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10782#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10782: Existential variables not scoped? -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => invalid Comment: Ah. After quite a bit more staring at the situation, I now understand. Existential variables are ''not'' added to `tcl_tyvars` directly. But all free variables of anything that is in scope (term-level or type-level) ''are'' added there. Because you can't ever get to a type variable unless it is in scope or something that mentions it is in scope, this is all OK. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10782#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10782: Existential variables not scoped? -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler (Type | Version: 7.11 checker) | Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Ah yes, I see too. Maybe add a comment with `tcl_tyvars`? And I keep thinking that we could do better by using the level numbers now stored in type variables... just never quite get to it. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10782#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC