Opened 7 years ago

Closed 6 years ago

#5534 closed bug (fixed)

ghci -fobject-code strangeness

Reported by: simonmar Owned by: simonmar
Priority: high Milestone: 7.4.2
Component: GHCi Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


With this Foo.hs:

module Foo (b) where

a = 2
b = 3
c = 4

I get this strange behaviour:

> ghci -fobject-code
GHCi, version 7.0.3:  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :l foo
[1 of 1] Compiling Foo              ( foo.hs, foo.o )
Ok, modules loaded: Foo.
*Foo> :browse
b :: Integer
*Foo> a

    Can't find interface-file declaration for variable a
      Probable cause: bug in .hi-boot file, or inconsistent .hi file
      Use -ddump-if-trace to get an idea of which file caused the error
    In the expression: a
    In an equation for `it': it = a

So a is in scope, but it can't be used. Furthermore, :browse *Foo does not show a or c (it does without -fobject-code).

Change History (5)

comment:1 Changed 6 years ago by igloo

Priority: normallow

comment:2 Changed 6 years ago by simonmar

difficulty: Unknown
Owner: set to simonmar
Priority: lowhigh

comment:3 Changed 6 years ago by marlowsd@…

commit 9fa9dd773fc10a89b05d1456cfe55b79c5bd608c

Author: Simon Marlow <>
Date:   Wed Feb 15 10:01:21 2012 +0000

    fix #5534 (ghci -fobject-code strangeness)

 compiler/deSugar/Desugar.lhs |    4 ++--
 compiler/iface/MkIface.lhs   |   15 +++++++++++++--
 compiler/main/DynFlags.hs    |   12 ++++++++++++
 3 files changed, 27 insertions(+), 4 deletions(-)

comment:4 Changed 6 years ago by simonmar

Status: newmerge

comment:5 Changed 6 years ago by pcapriotti

Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.