[GHC] #9479: Report required constraints when reporting the type of a hole
GHC
ghc-devs at haskell.org
Tue Dec 15 19:26:28 UTC 2015
#9479: Report required constraints when reporting the type of a hole
-------------------------------------+-------------------------------------
Reporter: | Owner:
dominiquedevriese |
Type: feature request | Status: new
Priority: normal | Milestone: 8.0.1
Component: Compiler (Type | Version: 7.8.3
checker) |
Resolution: | Keywords: holes
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 thomie):
This is fixed in HEAD.
{{{
$ ghc-7.11.20151213 Test.hs
[1 of 1] Compiling Test ( Test.hs, Test.o )
Test.hs:4:8: error:
• Ambiguous type variable ‘a0’ arising from a use of ‘show’
prevents the constraint ‘(Show a0)’ from being solved.
Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance Show Module -- Defined in ‘GHC.Show’
instance Show Ordering -- Defined in ‘GHC.Show’
instance Show TrName -- Defined in ‘GHC.Show’
...plus 25 others
(use -fprint-potential-instances to see them all)
• In the expression: show _h
In an equation for ‘test’: test = show _h
Test.hs:4:13: error:
• Found hole: _h :: a0
Where: ‘a0’ is an ambiguous type variable
Or perhaps ‘_h’ is mis-spelled, or not in scope
• In the first argument of ‘show’, namely ‘_h’
In the expression: show _h
In an equation for ‘test’: test = show _h
• Relevant bindings include test :: String (bound at Test.hs:4:1)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9479#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list