Ticket #5051 (new bug)
Typechecker behaviour change
|Reported by:||igloo||Owned by:|
|Type of failure:||None/Unknown||Difficulty:||Unknown|
|Test Case:||typecheck/should_compile/T5051||Blocked By:|
The behaviour has changed (7.0.1 accepts it, 7.0.2 doesn't), but I'm not sure which behaviour is right.
I've put a cut-down (but not standalone) version of the offending module below. I believe the relevant steps are then:
The ct application means we need an instance for: Cast (ResidueI (Pol (ResidueE (UPol k)))) (Pol (ResidueE (UPol k))) Need: Cast (ResidueI (Pol (ResidueE (UPol k)))) (Pol (ResidueE (UPol k))) Have: instance LinSolvRing a => Cast (ResidueI a) a Now need: LinSolvRing (Pol (ResidueE (UPol k))) Have: instance EuclideanRing a => LinSolvRing (Pol a) Now need: EuclideanRing (ResidueE (UPol k)) Have: instance (EuclideanRing a, Ring (ResidueE a) ) => EuclideanRing (ResidueE a) Now need: EuclideanRing (UPol k) Have: instance Field a => EuclideanRing (UPol a) Now need: LinSolvRing (UPol k) (from the EuclideanRing class constraints) Have: instance EuclideanRing a => LinSolvRing (UPol a) (Pol2_.hs:95) And: instance (LinSolvRing (Pol a), CommutativeRing a) => LinSolvRing (UPol (Pol a)) A different instance should be used depending on whether or not k = Pol x (for some x).
-XTypeSynonymInstances -XUndecidableInstances -XFlexibleContexts -XFlexibleInstances -XMultiParamTypeClasses -XOverlappingInstances -XRecordWildCards -XNamedFieldPuns -XScopedTypeVariables -fcontext-stack=30
module T_cubeext (cubicExt) where import Prelude (undefined) import DPrelude (ct) import Categs (ResidueE) import SetGroup () import RingModule (Field, FactorizationRing) import VecMatr () import Fraction () import Pol (Pol, UPol) import Residue (ResidueI) import GBasis () cubicExt :: forall k . (Field k, FactorizationRing (UPol k)) => k -> () cubicExt _ = undefined where unE :: ResidueI (Pol (ResidueE (UPol k))) unE = undefined kToE :: Pol (ResidueE (UPol k)) -> ResidueI (Pol (ResidueE (UPol k))) kToE = ct unE