id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
4361,Typechecker regression,igloo,simonpj,"Here's the essence of the regression DoCon showed up, reported here:
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2010-September/025511.html

{{{
{-# LANGUAGE FlexibleContexts #-}

module Pol3_ (moduloBasisx) where

class CommutativeRing a
class CommutativeRing a => LinSolvRing a
class LinSolvRing a => EuclideanRing a

instance EuclideanRing a => LinSolvRing (Pol a)
instance CommutativeRing a => CommutativeRing (Pol a)

data Pol a = MkPol

upLinSolvRing :: LinSolvRing a => a -> ()
upLinSolvRing = undefined

moduloBasisx :: (LinSolvRing (Pol a), CommutativeRing a) => Pol a -> ()
moduloBasisx p = let x = upLinSolvRing p
                 in ()
}}}

{{{
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.2
$ ghc --make Pol3_
[1 of 1] Compiling Pol3_            ( Pol3_.hs, Pol3_.o )
$
}}}

{{{
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.0.20100924
$ ghc --make Pol3_
[1 of 1] Compiling Pol3_            ( Pol3_.hs, Pol3_.o )

Pol3_.hs:19:26:
    Could not deduce (EuclideanRing a)
      from the context (LinSolvRing (Pol a), CommutativeRing a)
      arising from a use of `upLinSolvRing'
    Possible fix:
      add (EuclideanRing a) to the context of
        the type signature for `moduloBasisx'
    In the expression: upLinSolvRing p
    In an equation for `x': x = upLinSolvRing p
    In the expression: let x = upLinSolvRing p in ()
$
}}}
",bug,closed,high,7.0.1,Compiler (Type checker),7.1,fixed,,mechvel@…,Unknown/Multiple,Unknown/Multiple,None/Unknown,Unknown,typecheck/should_compile/T4361,,,
