Skip to content

Compile error on GHC 8.8.3: GHC.Pat TypecheckI vs GHC.GenLocated SrcSpan #94

@ulidtko

Description

@ulidtko

GHC 8.8.3, hdevtools latest master (0.1.8.0-0-geab7092):

ulidtko@pasocon ~/s/hdevtools (master)> cabal build
Resolving dependencies...
Build profile: -w ghc-8.8.3 -O1
In order, the following will be built (use -v for more details):
 - hdevtools-0.1.8.0 (exe:hdevtools) (first run)
Configuring executable 'hdevtools' for hdevtools-0.1.8.0..
Preprocessing executable 'hdevtools' for hdevtools-0.1.8.0..
Building executable 'hdevtools' for hdevtools-0.1.8.0..
[ 1 of 14] Compiling Daemonize        ( src/Daemonize.hs, /home/ulidtko/src/hdevtools/dist-newstyle/build/x86_64-linux/ghc-8.8.3/hdevtools-0.1.8.0/x/hdevtools/build/hdevtools/hdevtools-tmp/Daemonize.dyn_o )
[ 2 of 14] Compiling GhcTypes         ( src/GhcTypes.hs, /home/ulidtko/src/hdevtools/dist-newstyle/build/x86_64-linux/ghc-8.8.3/hdevtools-0.1.8.0/x/hdevtools/build/hdevtools/hdevtools-tmp/GhcTypes.dyn_o )
[ 3 of 14] Compiling FindSymbol       ( src/FindSymbol.hs, /home/ulidtko/src/hdevtools/dist-newstyle/build/x86_64-linux/ghc-8.8.3/hdevtools-0.1.8.0/x/hdevtools/build/hdevtools/hdevtools-tmp/FindSymbol.dyn_o )
[ 4 of 14] Compiling Info             ( src/Info.hs, /home/ulidtko/src/hdevtools/dist-newstyle/build/x86_64-linux/ghc-8.8.3/hdevtools-0.1.8.0/x/hdevtools/build/hdevtools/hdevtools-tmp/Info.dyn_o )

src/Info.hs:89:14: error:
    • Couldn't match type ‘GHC.GenLocated GHC.SrcSpan a0’
                     with ‘GHC.Pat TypecheckI’
      Expected type: [GHC.LPat TypecheckI]
        Actual type: [GHC.Located a0]
    • In the expression:
          listifySpans tcs (line, col) :: [GHC.LPat TypecheckI]
      In an equation for ‘ps’:
          ps = listifySpans tcs (line, col) :: [GHC.LPat TypecheckI]
      In the expression:
        do let tcs = GHC.tm_typechecked_source tcm
               bs = ...
               ....
           bts <- mapM (getTypeLHsBind tcm) bs
           ets <- mapM (getTypeLHsExpr tcm) es
           pts <- mapM (getTypeLPat tcm) ps
           ....
   |
89 |         ps = listifySpans tcs (line, col) :: [GHC.LPat TypecheckI]
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Info.hs:158:16: error:
    • Couldn't match type ‘GHC.GenLocated
                             GHC.SrcSpan (GHC.Pat GHC.GhcTc)’
                     with ‘GHC.Pat TypecheckI’
      Expected type: GHC.LPat TypecheckI
        Actual type: GHC.GenLocated GHC.SrcSpan (GHC.Pat GHC.GhcTc)
    • In the pattern: GHC.L spn pat
      In an equation for ‘getTypeLPat’:
          getTypeLPat _ (GHC.L spn pat)
            = return $ Just (spn, TcHsSyn.hsPatType pat)
    |
158 | getTypeLPat _ (GHC.L spn pat) = return $ Just (spn, TcHsSyn.hsPatType pat)
    |                ^^^^^^^^^^^^^

Yet another GHC API breakage, I guess.

Anyone aware of fixes or workarounds?

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