[GHC] #12055: Typechecker panic instead of proper error
GHC
ghc-devs at haskell.org
Fri May 13 11:29:45 UTC 2016
#12055: Typechecker panic instead of proper error
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 8.0.2
Component: Compiler (Type | Version: 8.0.1
checker) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time | Unknown/Multiple
crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
Well HEAD for this gives
{{{
T12055.hs:18:1: error:
• Non type-variable argument in the constraint: Category (Dom f)
(Use FlexibleContexts to permit this)
• In the context: (Category (Dom f), Category (Cod f))
While checking the super-classes of class ‘Functor’
In the class declaration for ‘Functor’
T12055.hs:26:1: error:
• Fundeps in class ‘Fun’
(Use FunctionalDependencies to allow fundeps)
• In the class declaration for ‘Fun’
T12055.hs:29:5: error:
• Illegal instance declaration for ‘Fun p q f’
(All instance types must be of the form (T a1 ... an)
where a1 ... an are *distinct type variables*,
and each type variable appears at most once in the instance head.
Use FlexibleInstances if you want to disable this.)
• In the instance declaration for
‘Fun (p :: Cat j) (q :: Cat k) (f :: j -> k)’
}}}
And if you add the missing language extensions
{{{
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
}}}
then it compiles cleanly.
I suppose someone could bisect their way to the patch that fixed HEAD. Or
we could just leave it.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12055#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list