Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Type errors in GhcMod.Gap #935

Closed
judemille opened this issue May 10, 2018 · 1 comment
Closed

Type errors in GhcMod.Gap #935

judemille opened this issue May 10, 2018 · 1 comment

Comments

@judemille
Copy link

judemille commented May 10, 2018

When running stack install ghc-mod with GHC 8.2.2-1, the following errors occur:

    [19 of 59] Compiling GhcMod.Gap       ( core/GhcMod/Gap.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/build/GhcMod/Gap.o )
    
    /tmp/stack16377/ghc-mod-5.8.0.0/core/GhcMod/Gap.hs:156:12: error:
        • Couldn't match type ‘UTCTime’
                         with ‘time-1.8.0.2:Data.Time.Clock.Internal.UTCTime.UTCTime’
          NB: ‘time-1.8.0.2:Data.Time.Clock.Internal.UTCTime.UTCTime’
                is defined in ‘Data.Time.Clock.Internal.UTCTime’
                    in package ‘time-1.8.0.2’
              ‘UTCTime’
                is defined in ‘Data.Time.Clock.Internal.UTCTime’
                    in package ‘time-1.8.0.2’
          Expected type: TargetId
                         -> Bool -> Maybe (StringBuffer, UTCTime) -> Target
            Actual type: TargetId
                         -> Bool
                         -> Maybe
                              (StringBuffer,
                               time-1.8.0.2:Data.Time.Clock.Internal.UTCTime.UTCTime)
                         -> Target
        • In the expression: Target
          In an equation for ‘mkTarget’: mkTarget = Target
        |
    156 | mkTarget = Target
        |            ^^^^^^
    
    /tmp/stack16377/ghc-mod-5.8.0.0/core/GhcMod/Gap.hs:429:31: error:
        • Couldn't match expected type ‘IfaceSyn.ShowSub’
                      with actual type ‘TyThing’
        • In the first argument of ‘pprTyThingInContextLoc'’, namely
            ‘thing’
          In the first argument of ‘($$)’, namely
            ‘pprTyThingInContextLoc' thing’
          In the first argument of ‘($$)’, namely
            ‘pprTyThingInContextLoc' thing $$ show_fixity fixity’
        |
    429 |     = pprTyThingInContextLoc' thing
        |                               ^^^^^
    
    /tmp/stack16377/ghc-mod-5.8.0.0/core/GhcMod/Gap.hs:445:74: error:
        • Couldn't match expected type ‘SDoc’
                      with actual type ‘TyThing -> SDoc’
        • Probable cause: ‘pprTyThingInContext’ is applied to too few arguments
          In the second argument of ‘showWithLoc’, namely
            ‘(pprTyThingInContext thing')’
          In the expression:
            showWithLoc (pprDefinedAt' thing') (pprTyThingInContext thing')
          In an equation for ‘pprTyThingInContextLoc'’:
              pprTyThingInContextLoc' thing'
                = showWithLoc (pprDefinedAt' thing') (pprTyThingInContext thing')
        |
    445 |     pprTyThingInContextLoc' thing' = showWithLoc (pprDefinedAt' thing') (pprTyThingInContext thing')
        |                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    /tmp/stack16377/ghc-mod-5.8.0.0/core/GhcMod/Gap.hs:575:55: error:
        • The constructor ‘HsIB’ should have 3 arguments, but has been given 2
        • In the pattern:
            HsIB _
                 (L _
                    (HsForAllTy _ (L _ (HsAppTy (L _ (HsTyVar (L _ className))) _))))
          In the pattern:
            ClsInstDecl {cid_poly_ty = HsIB _
                                            (L _
                                               (HsForAllTy _
                                                           (L _
                                                              (HsAppTy (L _ (HsTyVar (L _ className)))
                                                                       _))))}
          In the pattern:
            ClsInstD (ClsInstDecl {cid_poly_ty = HsIB _
                                                      (L _
                                                         (HsForAllTy _
                                                                     (L _
                                                                        (HsAppTy (L _
                                                                                    (HsTyVar (L _
                                                                                                className)))
                                                                                 _))))})
        |
    575 | getClass [L loc (ClsInstD (ClsInstDecl {cid_poly_ty = HsIB _ (L _ (HsForAllTy _ (L _ (HsAppTy (L _ (HsTyVar (L _ className))) _))))}))] = Just (className, loc)
        |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    /tmp/stack16377/ghc-mod-5.8.0.0/core/GhcMod/Gap.hs:671:26: error:
        • Couldn't match expected type ‘(a, b0)’
                      with actual type ‘DynFlags -> Messages’
        • Probable cause: ‘getMessages’ is applied to too few arguments
          In the expression: getMessages pst
          In a pattern binding: (warns, _) = getMessages pst
          In the expression:
            let (warns, _) = getMessages pst in Right (warns, rdr_module)
        • Relevant bindings include
            warns :: a (bound at core/GhcMod/Gap.hs:671:15)
        |
    671 |          let (warns,_) = getMessages pst in
        |                          ^^^^^^^^^^^^^^^
    

@DanielG
Copy link
Owner

DanielG commented May 31, 2018

ghc-mod does not yet support GHC 8.2, see #900. I have no idea how you got stack to even attempt to build it :)

@DanielG DanielG closed this as completed May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants