[GHC] #13687: GHC internal error: associated type not in scope during typechecking

GHC ghc-devs at haskell.org
Thu May 11 09:17:33 UTC 2017


#13687: GHC internal error: associated type not in scope during typechecking
-------------------------------------+-------------------------------------
        Reporter:  mrkgnao           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by mrkgnao:

@@ -1,1 +1,1 @@
- From a larger snippet of code:
+ Trying to add a really bad associated type to a class as follows
@@ -14,0 +14,22 @@
+
+ triggers
+
+ {{{
+
+ /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’
+ }}}

New description:

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

 {{{#!hs
 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
 }}}

 triggers

 {{{

 /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’
 }}}

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13687#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list