Typechecker regression
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 ()
$
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |