Opened 2 years ago

Closed 2 years ago

#13687 closed bug (duplicate)

GHC internal error: associated type not in scope during typechecking

Reported by: mrkgnao Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 8.0.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case:
Blocked By: Blocking:
Related Tickets: #12867 Differential Rev(s):
Wiki Page:

Description (last modified by mrkgnao)

Trying to add a really bad associated type to a class as follows

type family Strategy' a b n where
  Strategy' a b Zero = St a b -- this is where the error occurs
  Strategy' a b (Succ n)
    = Strategy' a b n
   <| ReverseArgs (Strategy' b a n)
   <| Combine (Strategy' a a n) (Strategy' b b n)

class DefinedStrategy a b where
  type St


/home/mrkgnao/code/haskell/noether/library/Algebra/DeOverlap.hs:126:24: error:
    • GHC internal error: ‘St’ is not in scope during type checking, but it passed the renamer
      tcl_env of environment: [amtJ :-> Type variable ‘a’ = a,
                               amtK :-> Type variable ‘b’ = b, roW :-> ATcTyCon Strategy']
    • In the type ‘St a b’
      In the type family declaration for ‘Strategy'’

/home/mrkgnao/code/haskell/noether/library/Algebra/DeOverlap.hs:132:1: error:
    • The associated type ‘St’
      mentions none of the type or kind variables of the class ‘DefinedStrategy a b’
    • In the class declaration for ‘DefinedStrategy’

Change History (2)

comment:1 Changed 2 years ago by mrkgnao

Description: modified (diff)

comment:2 Changed 2 years ago by RyanGlScott

Resolution: duplicate
Status: newclosed

Thanks for the bug report. This is a duplicate of #12867, which has been fixed in GHC 8.2.1.

Note: See TracTickets for help on using tickets.