[Git][ghc/ghc][master] Add a testcase for #17564

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Sep 27 21:34:48 UTC 2023



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


Commits:
79104334 by Krzysztof Gogolewski at 2023-09-27T17:34:04-04:00
Add a testcase for #17564

The code in the ticket relied on the behaviour of Derived constraints.
Derived constraints were removed in GHC 9.4 and now the code works
as expected.

- - - - -


2 changed files:

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


Changes:

=====================================
testsuite/tests/typecheck/should_compile/T17564.hs
=====================================
@@ -0,0 +1,22 @@
+{-# LANGUAGE QuantifiedConstraints, MultiParamTypeClasses,
+             KindSignatures, FlexibleInstances, TypeFamilies #-}
+
+module T17564 where
+
+import Data.Kind
+
+class (forall (a :: Type -> Type). a b ~ a c) => C b c
+instance C a a
+
+class (b ~ c) => D b c
+instance D a a
+
+foo :: C a b => a -> b
+foo = undefined
+
+bar = foo
+
+food :: D a b => a -> b
+food = undefined
+
+bard = food


=====================================
testsuite/tests/typecheck/should_compile/all.T
=====================================
@@ -894,3 +894,4 @@ test('TcIncompleteRecSel', normal, compile, ['-Wincomplete-record-selectors'])
 test('InstanceWarnings', normal, multimod_compile, ['InstanceWarnings', ''])
 test('T23861', normal, compile, [''])
 test('T23918', normal, compile, [''])
+test('T17564', normal, compile, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/79104334bb77c1b340b6ebe6818ed5ba1031c2ff

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/79104334bb77c1b340b6ebe6818ed5ba1031c2ff
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/20230927/c9258109/attachment-0001.html>


More information about the ghc-commits mailing list