Skip to content

Build error with GHC 8.10.7 in ghc-source-gen-0.4.4.0 #109

@cumber

Description

@cumber

When building with GHC 8.10.7, I get this error:

[10 of 25] Compiling GHC.SourceGen.Module ( src/GHC/SourceGen/Module.hs, dist/build/GHC/SourceGen/Module.o, dist/build/GHC/SourceGen/Module.dyn_o )

src/GHC/SourceGen/Module.hs:191:41: error:
    Variable not in scope: unqual :: OccNameStr -> RdrNameStr
    |
191 |                     (map (wrappedName . unqual) cs)
    |                                         ^^^^^^

This appears to have broken due to #103, which split

import GHC.SourceGen.Name
    ( RdrNameStr, ModuleNameStr(unModuleNameStr), OccNameStr, unqual )

into

#if MIN_VERSION_ghc(9,0,0)
import GHC.SourceGen.Name (unqual)
#endif
#if MIN_VERSION_ghc(9,4,0)
import GHC.SourceGen.Name (RdrNameStr, ModuleNameStr(unModuleNameStr), OccNameStr)

However the usage of unqual at src/GHC/SourceGen/Module.hs:191 appears to be outside any #if, so I think GHC.SourceGen.Name needs to be imported unconditionally (at least unqual).

Or, if the intent was that GHC 9.0.0 is now the minimum supported version, the cabal file needs to be updated (and a revision pushed to Hackage) so that 0.4.4.0 isn't selected when building on older compilers.

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