[GHC] #15596: When a type application cannot be applied to an identifier due to the absence of an explicit type signature, let the error just say so!

#15596: When a type application cannot be applied to an identifier due to the absence of an explicit type signature, let the error just say so! -------------------------------------+------------------------------------- Reporter: kindaro | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider this code: {{{#!hs {-# language TypeApplications #-} module TypeApplicationsErrorMessage where f = (+) g = f @Integer }}} This is what happens when I try to compile it: {{{#!hs % ghc TypeApplicationsErrorMessage.hs [1 of 1] Compiling TypeApplicationsErrorMessage ( TypeApplicationsErrorMessage.hs, TypeApplicationsErrorMessage.o ) TypeApplicationsErrorMessage.hs:6:5: error: • Cannot apply expression of type ‘a0 -> a0 -> a0’ to a visible type argument ‘Integer’ • In the expression: f @Integer In an equation for ‘g’: g = f @Integer | 6 | g = f @Integer | ^^^^^^^^^^ }}} This error is easily fixed by supplying an explicit type signature to `f`. So, perhaps the error message could just say so? I am observing this with `The Glorious Glasgow Haskell Compilation System, version 8.6.0.20180810`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15596 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15596: When a type application cannot be applied to an identifier due to the absence of an explicit type signature, let the error just say so! -------------------------------------+------------------------------------- Reporter: kindaro | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: Resolution: | Keywords: 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 goldfire): This is most certainly a reasonable request. I don't have time right now to look into how hard this would be to arrange, though... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15596#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15596: When a type application cannot be applied to an identifier due to the absence of an explicit type signature, let the error just say so! -------------------------------------+------------------------------------- Reporter: kindaro | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler (Type | Version: 8.4.3 checker) | Keywords: Resolution: | TypeApplications 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: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: => TypeApplications * failure: None/Unknown => Poor/confusing error message * version: => 8.4.3 * component: Compiler => Compiler (Type checker) * milestone: => 8.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15596#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC