From bb8442c975cd6b9f70c3f15cc09b2925594b11e1 Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 17 Aug 2000 16:28:44 +0000 Subject: [PATCH] [project @ 2000-08-17 16:28:44 by simonmar] Replace a zipEqual with a zip in tcPat when checking a record pat. The former version caused a panic with DEBUG on if a record pattern was used with a non-record constructor. --- ghc/compiler/typecheck/TcPat.lhs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/typecheck/TcPat.lhs b/ghc/compiler/typecheck/TcPat.lhs index e0cb157..e5b8847 100644 --- a/ghc/compiler/typecheck/TcPat.lhs +++ b/ghc/compiler/typecheck/TcPat.lhs @@ -213,9 +213,11 @@ tcPat tc_bndr pat@(RecPatIn name rpats) pat_ty -- Check the constructor itself tcConstructor pat name pat_ty `thenTc` \ (data_con, ex_tvs, dicts, lie_avail1, arg_tys) -> let - field_tys = zipEqual "tcPat" - (map fieldLabelName (dataConFieldLabels data_con)) - arg_tys + -- not zipEqual: if the constructor isn't really a record, then + -- dataConFieldLabels will be empty (and each field in the pattern + -- will generate an error below). + field_tys = zip (map fieldLabelName (dataConFieldLabels data_con)) + arg_tys in -- Check the fields -- 1.7.10.4