From: simonmar Date: Thu, 17 Aug 2000 16:28:44 +0000 (+0000) Subject: [project @ 2000-08-17 16:28:44 by simonmar] X-Git-Tag: Approximately_9120_patches~3867 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=bb8442c975cd6b9f70c3f15cc09b2925594b11e1;p=ghc-hetmet.git [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. --- 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