Skip to content

Haddock 2 can not process the base package with HscTarget = HscNothing

My guess is that this is a problem with the load function from the GHC API.

When Haddock 2 has HscTarget set to HscNothing, running it on the base package yields the following GHC error message:

Foreign/Storable.hs:158:58:
    Couldn't match expected type `Integer' against inferred type `Int'
    In the first argument of `(*)', namely `off'
    In the second argument of `peekByteOff', namely
        `(off * sizeOf undef)'
    In the expression: peekByteOff ptr (off * sizeOf undef)

Foreign/Storable.hs:162:46:
    Couldn't match expected type `Integer' against inferred type `Int'
    In the first argument of `(*)', namely `off'
    In the second argument of `pokeByteOff', namely
        `(off * sizeOf val)'
    In the expression: pokeByteOff ptr (off * sizeOf val) val

When HscTarget is set to HscAsm, the base package compiles fine using Haddock 2.

This is the coded used to load files in Haddock 2, the same code that produces the error message:

typecheckFiles session files = do 

  -- load all argument files

  targets <- mapM (\f -> guessTarget f Nothing) files
  setTargets session targets
Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHC API
Test case
Differential revisions
BlockedBy
Related
Blocking
CC david.waern@gmail.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information