[GHC] #13677: Incorrect parenthesization of type in error message

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Poor/confusing Unknown/Multiple | error message Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If you compile this program: {{{#!hs {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE GADTs #-} import GHC.Exts (Constraint) data Dict a where Dict :: a => Dict a foo :: Dict (Int ~ Int) => Int foo = undefined }}} In GHC 8.0.1, 8.0.2, 8.2.1, or HEAD, it will give this error message: {{{ GHCi, version 8.3.20170509: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug2.hs, interpreted ) Bug2.hs:9:8: error: • Expected a constraint, but ‘Dict Int ~ Int’ has kind ‘*’ • In the type signature: foo :: Dict (Int ~ Int) => Int | 9 | foo :: Dict (Int ~ Int) => Int | ^^^^^^^^^^^^^^^^ }}} But `Dict Int ~ Int` is not parenthesized correctly! This is a regression, as GHC 7.10.3 and earlier parenthesize it correctly: {{{ GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( Bug2.hs, interpreted ) Bug2.hs:9:8: Expected a constraint, but ‘Dict (Int ~ Int)’ has kind ‘*’ In the type signature for ‘foo’: foo :: Dict (Int ~ Int) => Int }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Commit 09b872dc61590a71c28feb37c37bf864664efaf7 (Make equality print better. (#11712)) is responsible. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3570 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D3570 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13677: Incorrect parenthesization of type in error message
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3570
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: merge Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3570 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge * milestone: => 8.2.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3570 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged with 66d5e8015bed91fd0e2091641fe855c433c24b6c. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13677: Incorrect parenthesization of type in error message
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone: 8.2.1
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Poor/confusing | Unknown/Multiple
error message | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3570
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#13677: Incorrect parenthesization of type in error message -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Poor/confusing | Unknown/Multiple error message | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3570 Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): PS: no need to merge this... just tidying up -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13677#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC