From 43b08cfbac5ce7ad6fc245651329094896de06e0 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Tue, 21 Aug 2018 15:57:56 +0100 Subject: Add a solveEqualities to tcClassDecl1 Trac #15505 showed that, when we have a type error, we could have an unfilled-in coercion hole. We don't want an assertion error in that case. The underlying cause is that tcClassDecl1 should call solveEqualities to fully solve all top-level equalities (or fail in the attempt). I also refactored the ClassDecl case for tcTyClDecl1 into a new function tcClassDecl1. That makes it symmetrical with the others. --- compiler/parser/RdrHsSyn.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/parser/RdrHsSyn.hs') diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 681ecdeae0..5784b9ecdb 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -78,7 +78,6 @@ module RdrHsSyn ( import GhcPrelude import HsSyn -- Lots of it -import Class ( FunDep ) import TyCon ( TyCon, isTupleTyCon, tyConSingleDataCon_maybe ) import DataCon ( DataCon, dataConTyCon ) import ConLike ( ConLike(..) ) @@ -142,7 +141,7 @@ mkInstD (L loc d) = L loc (InstD noExt d) mkClassDecl :: SrcSpan -> Located (Maybe (LHsContext GhcPs), LHsType GhcPs) - -> Located (a,[Located (FunDep (Located RdrName))]) + -> Located (a,[LHsFunDep GhcPs]) -> OrdList (LHsDecl GhcPs) -> P (LTyClDecl GhcPs) -- cgit v1.2.1