Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Invoking TH in another module triggers error about unknown _closure symbol #650

@leftaroundabout

Description

@leftaroundabout

With GHC-HEAD (ghc-8.3.20170622) and haddock-ghc-HEAD 7cecbd9, I get

Resolving dependencies...
Configuring dumb-cas-0.1.0.0...
Preprocessing library for dumb-cas-0.1.0.0..
Running Haddock on library for dumb-cas-0.1.0.0..
Warning: The documentation for the following packages are not installed. No
links will be generated to these packages: array-0.5.1.2, base-4.10.0.0,
containers-0.5.10.2, deepseq-1.4.3.0, ghc-boot-th-8.3, ghc-prim-0.5.0.0,
integer-gmp-1.0.0.1, pretty-1.1.3.3, template-haskell-2.12.0.0
Haddock coverage:
   0% (  0 /  2) in 'CAS.Dumb.Util.These'
  Missing documentation for:
    Module header
    tuc (CAS/Dumb/Util/These.hs:3)
   0% (  0 /  4) in 'CAS.Dumb.Tree'
  Missing documentation for:
    Module header
    CAS (CAS/Dumb/Tree.hs:5)
    Ept (CAS/Dumb/Tree.hs:6)
    mp (CAS/Dumb/Tree.hs:8)
   0% (  0 /  2) in 'CAS.Dumb.Symbols.PatternGenerator'
  Missing documentation for:
    Module header
    templateFoo (CAS/Dumb/Symbols/PatternGenerator.hs:7)
haddock-2.17.3: /tmp/ghc18584_0/ghc_4.o: unknown symbol `dumbzmcaszm0zi1zi0zi0zm1ivh3qQbBmg3Azz8f9IvUmT_CASziDumbziUtilziThese_tuc_closure'

When trying to get the documentation for
https://github.com/leftaroundabout/dumb-cas/tree/haddock-bug/example-reduce/CAS/Dumb

module CAS.Dumb.Tree where
import CAS.Dumb.Util.These
mp :: Maybe (Int, ())
mp = tuc
module CAS.Dumb.Util.These where
tuc :: t (k, a)
tuc = undefined
{-# LANGUAGE TemplateHaskell       #-}
module CAS.Dumb.Symbols.ASCII () where
import CAS.Dumb.Tree
import CAS.Dumb.Symbols.PatternGenerator
type EP g = Bool
templateFoo ''EP ['A'..'Z']
module CAS.Dumb.Symbols.PatternGenerator where
import CAS.Dumb.Tree
import Language.Haskell.TH
templateFoo :: Name -> [Char] -> DecsQ
templateFoo _ _ = return []

The problem seems to be specific to this particular imports topology.

Issue does not occur with haddock-2.16.1 on ghc-7.10.2. I have not checked any versions of GHC or haddock in between.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions