Skip to content

Annotations not written to interface files

Small example:

module C where

data T a = T a

Compile it:

newbie:tests rl$ ~/projects/ndp/ghc/inplace/bin/ghc-stage2 -O2 -c C.hs
newbie:tests rl$ ls -l C.hi
-rw-r--r--  1 rl  rl  485  4 Dec 12:53 C.hi

Add an annotation: {-# ANN type T () #-}. Compile:

newbie:tests rl$ ~/projects/ndp/ghc/inplace/bin/ghc-stage2 -O2 -c C.hs
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
newbie:tests rl$ ls -l C.hi
-rw-r--r--  1 rl  rl  485  4 Dec 12:53 C.hi

Note that the interface file hasn't been updated. Remove C.hi and recompile:

newbie:tests rl$ rm C.hi
newbie:tests rl$ ~/projects/ndp/ghc/inplace/bin/ghc-stage2 -O2 -c C.hs
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
newbie:tests rl$ ls -l C.hi
-rw-r--r--  1 rl  rl  507  4 Dec 12:54 C.hi

Only now has the annotation been written to C.hi.

Trac metadata
Trac field Value
Version 6.13
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information