Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4361
Closed
Open
Issue created Oct 03, 2010 by Ian Lynagh <igloo@earth.li>@trac-igloo

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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking