[GHC] #1310: confusing error message when trying to give a
type-signature to an imported symbol
GHC
trac at galois.com
Sun Apr 29 13:16:03 EDT 2007
#1310: confusing error message when trying to give a type-signature to an imported
symbol
---------------------------+------------------------------------------------
Reporter: Isaac Dupree | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.6.1
Severity: normal | Keywords:
Difficulty: Unknown | Os: Unknown
Testcase: | Architecture: Unknown
---------------------------+------------------------------------------------
{{{
import Prelude(putStrLn,String,IO)
main = putStrLn "ha" --works fine; putStrLn _is_ in (this) scope
}}}
{{{
putStrLn :: String -> IO () --produces ghc error: Not in scope: `putStrLn'
}}}
{{{
Prelude.putStrLn :: String -> IO () --produces ghc error: Invalid type
signature
}}}
I think an error message more like "type signatures can't be given to
functions(or non-function data) not defined in the same module" in both
cases would be clearer. Not sure what the right phrase is for
"functions(or non-function data)", "symbols",?
{{{
main = putStrLn "ha"
where p :: String -> IO ()
p x = putStrLn x
--produces ghc error: Misplaced type signature: p :: String -> IO ()
}}}
which shows a little more understanding in that case... If someone didn't
understand how that style of type-signature could only appear parallel to
a definition, I'm not sure how helpful it is.
{{{
main = putStrLn "ha"
where putStrLn :: String -> IO ()
--produces ghc error for the second line: Not in scope: `putStrLn'
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1310>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
-------------- next part --------------
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs at haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
More information about the Glasgow-haskell-bugs
mailing list