#16401: Bad error message if we use TypeApplications with an identifier that doesn't exist
"GHC" <[email protected]> Thu, 07 Mar 2019 00:12:34 -0000
| Newsgroups | gmane.comp.lang.haskell.glasgow.bugs |
|---|---|
| Message-ID | <[email protected]> |
--===============4510816493812544817==
Content-Type: multipart/related;
boundary="===============3322681093594029983=="
--===============3322681093594029983==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
#16401: Bad error message if we use TypeApplications with an identifier that
doesn't exist
-------------------------------------+-------------------------------------
Reporter: Fuuzetsu | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.6.3
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:
-------------------------------------+-------------------------------------
{{{#!hs
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
module BadError where
foo :: Int
foo = doesNotExist @123
{-
[1 of 1] Compiling BadError ( BadError.hs, BadError.o )
BadError.hs:6:7: error:
• Cannot apply expression of type ‘t1’
to a visible type argument ‘123’
• In the expression: doesNotExist @123
In an equation for ‘foo’: foo = doesNotExist @123
|
6 | foo = doesNotExist @123
-}
}}}
What I would expect is for it to say that {{{doesNotExist}}} is not bound
as one might reasonably expect. This is very, very confusing and easy to
hit in real life. If you are exposing a function {{{f}}}, using it
somewhere with {{{f @123}}} but then later decide to remove or rename
{{{f}}}, the error message doesn't suggest at all that {{{f}}} has
disappeared and leaves the user scratching their head.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16401>