Commit bb8442c9 authored by simonmar's avatar simonmar
Browse files

[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.
parent 029814aa
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment