[GHC] #12177: Relevant bindings includes shadowed bindings

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | 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: -------------------------------------+------------------------------------- {{{ ezyang@sabre:~$ ghc-8.0 --interactive GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help Prelude> \x -> \x -> _ <interactive>:1:13: error: • Found hole: _ :: t2 Where: ‘t2’ is a rigid type variable bound by the inferred type of it :: t -> t1 -> t2 at <interactive>:1:1 • In the expression: _ In the expression: \ x -> _ In the expression: \ x -> \ x -> _ • Relevant bindings include x :: t1 (bound at <interactive>:1:8) x :: t (bound at <interactive>:1:2) it :: t -> t1 -> t2 (bound at <interactive>:1:1) }}} GHC should not report bindings which are shadowed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer 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 sgillespie): Using the above as an example, I presume the output should look like: {{{ <interactive>:1:13: error: • Found hole: _ :: t2 Where: ‘t2’ is a rigid type variable bound by the inferred type of it :: t -> t1 -> t2 at <interactive>:1:1 • In the expression: _ In the expression: \ x -> _ In the expression: \ x -> \ x -> _ • Relevant bindings include x :: t1 (bound at <interactive>:1:8) it :: t -> t1 -> t2 (bound at <interactive>:1:1) }}} Fare presumption? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer 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): Good point. Can't be hard; we have a lexical environment to hand to check against. Anyone want to have a go? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer 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 anniecherkaev): I think I've got it working! I'll work through the contributing a patch guide and try submitting a patch later today or tomorrow! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer 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 ezyang): anniecherkaev: That's awesome! I'll be happy to review your patch, keep us posted. Let me know if you have any questions. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2434 Wiki Page: | -------------------------------------+------------------------------------- Changes (by anniecherkaev): * status: new => patch * differential: => Phab:D2434 Comment: Great, thanks! I just got a patch up on Phabricator. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner:
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords: newcomer
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2434
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Edward Z. Yang

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T12177 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2434 Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => typecheck/should_fail/T12177 Comment: It looks as though Edward committed the patch, so shouldn't the status change to 'merge' or 'fixed' depending on whether we plan to merge this to 8.0? I've also updated the Testcase: field, which no one seems to do. Thanks Annie and Edward. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T12177 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2434 Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => merge * milestone: => 8.0.2 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T12177 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2434 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12177: Relevant bindings includes shadowed bindings -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_fail/T12177 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2434 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Merged to `ghc-8.0` as 88b781283b728f72f2fcbae82037dd3d7f407e7a. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12177#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC