[GHC] #13626: Ambiguity when exporting a data constructor despite qualification

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | 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: -------------------------------------+------------------------------------- {{{ $ cat A.hs module A where data T = Cons $ cat B.hs module B (T(T)) where import qualified A data T = T $ ghc-8.2.0.20170422 -Wall B.hs [2 of 2] Compiling B ( B.hs, B.o ) [A changed] B.hs:1:11: error: • Ambiguous occurrence ‘T’ It could refer to either ‘A.T’, imported qualified from ‘A’ at B.hs:3:1-18 or ‘T’, defined at B.hs:5:1 • In the export: T(T) | 1 | module B (T(T)) where | ^^^^ }}} There should be no ambiguity, because there is only one data constructor named `T`. Even if `A.T`'s data constructor would also be called `T` there would be no ambiguity because `A` is imported with qualification. The problem does not appear, if `B.T`'s data constructor is named `Cons`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | 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 Lemming): I think that the problem was not present in earlier GHC-8.2 prereleases. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: mpickering Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | 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: | -------------------------------------+------------------------------------- Changes (by mpickering): * owner: (none) => mpickering -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: mpickering Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | 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 RyanGlScott): This is a duplicate of #13622, no? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: mpickering Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | Resolution: duplicate | 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: | -------------------------------------+------------------------------------- Changes (by Lemming): * status: new => closed * resolution: => duplicate -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: mpickering Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | Resolution: duplicate | 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 mpickering): I realised an easier way to fix this and implemented it on my wip refactoring branch. However, it isn't suitable to be merged as I have heavily refactored the surrounding code and it is implemented using 8.0 only features. I will prepare another fix for the 8.2 branch once I have finished working on this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13626: Ambiguity when exporting a data constructor despite qualification -------------------------------------+------------------------------------- Reporter: Lemming | Owner: mpickering Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1-rc2 (Parser) | Resolution: duplicate | 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 Lemming): With GHC-8.0 only features? As far as I can see, in GHC-8.0 the problem did not exist. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13626#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC