Ticket #1873: context.bug

File context.bug, 1.8 KB (added by claus, 6 years ago)

session log

Line 
1-- u.hs
2main = print ()
3---------------------------------------------------------
4$ /cygdrive/c/fptools/validate/ghc/compiler/stage2/ghc-inplace --interactive u.hs
5GHCi, version 6.9.20071111: http://www.haskell.org/ghc/  :? for help
6Loading package base ... linking ... done.
7[1 of 1] Compiling Main             ( u.hs, interpreted )
8Ok, modules loaded: Main.
9*Main> :e
10*Main> :r -- after deleting 'print' in u.hs
11[1 of 1] Compiling Main             ( u.hs, interpreted )
12
13u.hs:1:0:
14    Couldn't match expected type `IO a' against inferred type `()'
15    In the first argument of `GHC.TopHandler.runMainIO', namely `main'
16    When checking the type of the function `main'
17Failed, modules loaded: none.
18Prelude> :r -- after restoring 'print' in u.hs
19[1 of 1] Compiling Main             ( u.hs, interpreted )
20Ok, modules loaded: Main.
21Prelude> main
22
23<interactive>:1:0: Not in scope: `main'
24
25---------------------------------------------------------
26$ ghcii.sh u.hs
27   ___         ___ _
28  / _ \ /\  /\/ __(_)
29 / /_\// /_/ / /  | |      GHC Interactive, version 6.6.1, for Haskell 98.
30/ /_\\/ __  / /___| |      http://www.haskell.org/ghc/
31\____/\/ /_/\____/|_|      Type :? for help.
32
33Loading package base ... linking ... done.
34[1 of 1] Compiling Main             ( u.hs, interpreted )
35Ok, modules loaded: Main.
36*Main> :e
37*Main> :r -- after deleting 'print' in u.hs
38[1 of 1] Compiling Main             ( u.hs, interpreted )
39
40u.hs:1:0:
41    Couldn't match expected type `IO a' against inferred type `()'
42    In the first argument of `GHC.TopHandler.runMainIO', namely `main'
43    When checking the type of the main function `main'
44Failed, modules loaded: none.
45Prelude> :r -- after restoring 'print' in u.hs
46[1 of 1] Compiling Main             ( u.hs, interpreted )
47Ok, modules loaded: Main.
48*Main> main
49()
50