Simon Jakobi pushed to branch wip/sjakobi/regression-tests-2 at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • testsuite/tests/typecheck/should_compile/T14151.hs
    1
    +{-# LANGUAGE DataKinds #-}
    
    2
    +{-# LANGUAGE GADTs #-}
    
    3
    +{-# LANGUAGE KindSignatures #-}
    
    4
    +{-# LANGUAGE PolyKinds #-}
    
    5
    +{-# LANGUAGE RankNTypes #-}
    
    6
    +module T14151 where
    
    7
    +
    
    8
    +newtype HFix h a = HFix (h (HFix h) a)
    
    9
    +
    
    10
    +class EqForall f where
    
    11
    +  eqForall :: f a -> f a -> Bool
    
    12
    +
    
    13
    +class EqHetero h where
    
    14
    +  eqHetero :: (forall x. f x -> f x -> Bool) -> h f a -> h f a -> Bool
    
    15
    +
    
    16
    +instance EqHetero h => EqForall (HFix h) where
    
    17
    +  eqForall (HFix a) (HFix b) = eqHetero eqForall a b 
    
    18
    +
    
    19
    +instance EqHetero h => Eq (HFix h a) where
    
    20
    +  (==) = eqForall

  • testsuite/tests/typecheck/should_compile/all.T
    ... ... @@ -601,6 +601,7 @@ test('T13915b', expect_broken(15245), compile, [''])
    601 601
     test('T13984', normal, compile, [''])
    
    602 602
     test('T14128', normal, multimod_compile, ['T14128Main', '-v0'])
    
    603 603
     test('T14149', normal, compile_fail, [''])
    
    604
    +test('T14151', normal, compile, [''])
    
    604 605
     test('T14154', normal, compile, [''])
    
    605 606
     test('T14158', normal, compile, [''])
    
    606 607
     test('T13943', normal, compile, ['-fsolve-constant-dicts'])