[GHC] #9881: GHCi gives misleading error message when looking up info of ambiguous type

#9881: GHCi gives misleading error message when looking up info of ambiguous type -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Other Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- When GHCi imports multiple functions with the same name, using {{{:i}}} results in an ambiguous occurrence error: {{{
import Data.Text import Data.Text.Lazy :i length
Top level: Ambiguous occurrence ‘length’ It could refer to either ‘Data.Text.Lazy.length’, imported from ‘Data.Text.Lazy’ or ‘Prelude.length’, imported from ‘Prelude’ (and originally defined in ‘GHC.List’) or ‘Data.Text.length’, imported from ‘Data.Text’ }}} However, if you use {{{:i}}} on a type name that has imported multiple times in GHCi, a misleading error is given: {{{
import Data.Text import Data.Text.Lazy :i Text
Top level: Not in scope: data constructor ‘Text’ }}} The real problem is that the type name {{{Text}}} was imported twice with two different definitions, so the error should probably look something like this: {{{ Top level: Ambiguous occurrence ‘Text’ It could refer to either ‘Data.Text.Lazy.Text’, imported from ‘Data.Text.Lazy’ (and originally defined in ‘Data.Text.Internal.Lazy’) or ‘Data.Text.Text’, imported from ‘Data.Text’ (and originally defined in ‘Data.Text.Internal‘) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9881 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9881: GHCi gives misleading error message when looking up info of ambiguous type -------------------------------------+------------------------------------- Reporter: | Owner: simonpj RyanGlScott | Status: new Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHCi | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Other | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * owner: => simonpj Comment: Good point. I have a nice solution; more functinoality, less code. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9881#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9881: GHCi gives misleading error message when looking up info of ambiguous type
-------------------------------------+-------------------------------------
Reporter: | Owner: simonpj
RyanGlScott | Status: new
Type: bug | Milestone:
Priority: normal | Version: 7.8.3
Component: GHCi | Keywords:
Resolution: | Architecture: Unknown/Multiple
Operating System: | Difficulty: Unknown
Unknown/Multiple | Blocked By:
Type of failure: Other | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#9881: GHCi gives misleading error message when looking up info of ambiguous type -------------------------------------+------------------------------------- Reporter: | Owner: simonpj RyanGlScott | Status: closed Type: bug | Milestone: Priority: normal | Version: 7.8.3 Component: GHCi | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: Other | Related Tickets: Test Case: | ghci/scripts/T9881 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => ghci/scripts/T9881 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9881#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC