[Git][ghc/ghc][master] Add a regression test for #18920

Marge Bot gitlab at gitlab.haskell.org
Thu Nov 5 05:51:08 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
2125b1d6 by Ryan Scott at 2020-11-05T00:51:01-05:00
Add a regression test for #18920

Commit f594a68a5500696d94ae36425bbf4d4073aca3b2
(`Use level numbers for generalisation`) ended up fixing #18920. Let's add a
regression test to ensure that it stays fixed.

Fixes #18920.

- - - - -


2 changed files:

- + testsuite/tests/typecheck/should_compile/T18920.hs
- testsuite/tests/typecheck/should_compile/all.T


Changes:

=====================================
testsuite/tests/typecheck/should_compile/T18920.hs
=====================================
@@ -0,0 +1,37 @@
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE Rank2Types #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE GADTs #-}
+module T18920 where
+
+import Data.Kind
+
+class Monad solver => Solver solver where
+  type Constraint solver  :: Type
+  type Label solver       :: Type
+
+class Queue q
+
+data Tree s a where
+  NewVar :: Term s t => (t -> Tree s a) -> Tree s a
+
+class Solver solver => Term solver term
+
+class Transformer t where
+  type EvalState t :: Type
+  type TreeState t :: Type
+  type ForSolver t :: (Type -> Type)
+  type ForResult t :: Type
+  nextT :: SearchSig (ForSolver t) q t (ForResult t)
+  returnT :: ContinueSig solver q t (ForResult t)
+
+type ContinueSig solver  q t a =
+  ( Solver solver, Queue q, Transformer t  )
+  => Int -> q -> t -> EvalState t
+  -> solver (Int, [a])
+
+type SearchSig solver q t a =
+     (Solver solver, Queue q, Transformer t     )
+     => Int -> Tree solver a -> q -> t -> EvalState t -> TreeState t
+     -> solver (Int,[a])


=====================================
testsuite/tests/typecheck/should_compile/all.T
=====================================
@@ -725,6 +725,7 @@ test('T18470', normal, compile, [''])
 test('T18323', normal, compile, [''])
 test('T18585', normal, compile, [''])
 test('T18831', normal, compile, [''])
+test('T18920', normal, compile, [''])
 test('T15942', normal, compile, [''])
 test('ClassDefaultInHsBoot', [extra_files(['ClassDefaultInHsBootA1.hs','ClassDefaultInHsBootA2.hs','ClassDefaultInHsBootA2.hs-boot','ClassDefaultInHsBootA3.hs'])], multimod_compile, ['ClassDefaultInHsBoot', '-v0'])
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2125b1d6bea0c620e3a089603dace6bb38020c81

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2125b1d6bea0c620e3a089603dace6bb38020c81
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201105/e2f37633/attachment-0001.html>


More information about the ghc-commits mailing list