[GHC] #9109: Improve error messages around "untouchable" type variables

#9109: Improve error messages around "untouchable" type variables ------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- When I say {{{ {-# LANGUAGE GADTs #-} data G a where GBool :: G Bool foo GBool = True }}} I get {{{ Couldn't match expected type ‘t’ with actual type ‘Bool’ ‘t’ is untouchable inside the constraints (t1 ~ Bool) bound by a pattern with constructor GBool :: G Bool, in an equation for ‘foo’ at /Users/rae/temp/Bug.hs:6:5-9 ‘t’ is a rigid type variable bound by the inferred type of foo :: G t1 -> t at /Users/rae/temp/Bug.hs:6:1 Relevant bindings include foo :: G t1 -> t (bound at /Users/rae/temp/Bug.hs:6:1) In the expression: True In an equation for ‘foo’: foo GBool = True }}} My code is indeed bogus and the error message is accurate. But, it's really unhelpful in that the solution to my problem is "add a type signature". In general, I occasionally see folks complain about "untouchable" error messages. Most recently, see [http://www.haskell.org/pipermail/glasgow-haskell- users/2014-May/024993.html this thread], which inspired this report. Is the solution ''always'' to just add a type signature/annotation? Would it make sense to include a link to a stable wiki page about just what "untouchable" variables are? I don't necessarily have a solution to this problem, but I think it's worth thinking about. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9109: Improve error messages around "untouchable" type variables -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by dmwit): * cc: daniel@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9109: Improve error messages around "untouchable" type variables -------------------------------------+------------------------------------ Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by jstolarek): * cc: jan.stolarek@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9109: Improve error messages around "untouchable" type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by goldfire): See #9695 for another example. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9109: Improve error messages around "untouchable" type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by crockeea): * cc: ecrockett0@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9109: Improve error messages around "untouchable" type variables
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.8.2
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#9109: Improve error messages around "untouchable" type variables -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.8.2 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | typecheck/should_fail/T9109 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * testcase: => typecheck/should_fail/T9109 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9109#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC