From 9e5535ca667e060ce1431d42cdfc3a13ae080a88 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 2 Jan 2018 17:25:58 +0000 Subject: Fix OptCoercion In the presence of -fdefer-type-errors, OptCoercion can encounter a mal-formed coerercion with type T a ~ T a b and that was causing a subsequent Lint error. This caused Trac #14607. Easily fixed by turning an ASSERT into a guard. --- testsuite/tests/typecheck/should_fail/T14607.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 testsuite/tests/typecheck/should_fail/T14607.hs (limited to 'testsuite/tests/typecheck/should_fail/T14607.hs') diff --git a/testsuite/tests/typecheck/should_fail/T14607.hs b/testsuite/tests/typecheck/should_fail/T14607.hs new file mode 100644 index 0000000000..891d3ccc18 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T14607.hs @@ -0,0 +1,23 @@ +{-# OPTIONS_GHC -fdefer-type-errors #-} + -- This line is crucial to the bug + +{-# Language GADTs #-} +{-# Language InstanceSigs #-} +{-# Language KindSignatures #-} +{-# Language TypeFamilies #-} +{-# Language DataKinds #-} +{-# Language FlexibleInstances #-} + +module T14607 where + +import Data.Kind + +data LamCons :: Type -> Type -> () -> Type where + C :: LamCons a a '() + +class Mk a where + mk :: LamCons a a '() + +instance Mk a where + mk :: LamCons a '() + mk = mk -- cgit v1.2.1