[GHC] #11384: Error says to fix incorrect return type

#11384: Error says to fix incorrect return type -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: GADTs | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Defining a constructor that returns the wrong type (non-parent type). If the constructor is not fully-applied or over-saturated GHC reports an error, instead of telling the developer to change the return type: {{{ Prelude> data A Prelude> data B a where MkB :: A () <interactive>:2:23: error: • Expecting one fewer argument to ‘A’ Expected kind ‘* -> *’, but ‘A’ has kind ‘*’ • In the type ‘A ()’ In the definition of data constructor ‘MkB’ In the data declaration for ‘B’ }}} Expected: 1. Suggest GADTs: {{{ • Illegal generalised algebraic data declaration for ‘B’ (Use GADTs to allow GADTs) • In the data declaration for ‘B’ }}} 2. Complain about incorrect return type: {{{ • Data constructor ‘MkB’ returns type ‘A’ instead of an instance of its parent type ‘B a’ • In the definition of data constructor ‘MkB’ In the data type declaration for ‘B’ }}} It shouldn't suggest the user fix the incorrect return type -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11384 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11384: Error says to fix incorrect return type -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: GADTs Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: 8258 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * failure: None/Unknown => Incorrect warning at compile-time * version: 8.1 => 7.6.3 * blockedby: => 8258 Comment: Good idea. #8258 would help with the first suggestion (enabling `GADTs`). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11384#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11384: Error says to fix incorrect return type -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 7.6.3 checker) | Resolution: | Keywords: GADTs Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: 8258 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * component: Compiler => Compiler (Type checker) * milestone: => 8.4.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11384#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11384: Error says to fix incorrect return type -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.1 Component: Compiler (Type | Version: 7.6.3 checker) | Keywords: GADTs, Resolution: | TypeErrorMessages Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: 8258 | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * keywords: GADTs => GADTs, TypeErrorMessages -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11384#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC