don't typecheck record fields that are going to be discarded

This commit is contained in:
Krasimir Angelov
2025-05-21 13:56:19 +02:00
parent fd27a2ebd3
commit 8b93f80c52
@@ -654,9 +654,7 @@ checkRecFields scope c ((l,t):lts) ltys =
lttys <- checkRecFields scope c2 lts ltys
return (ltty : lttys)
(Nothing,ltys) -> do evalWarn ("Discarded field:" <+> l)
let (c1,c2) = split c
ltty <- tcRecField scope c1 l t Nothing
lttys <- checkRecFields scope c2 lts ltys
lttys <- checkRecFields scope c lts ltys
return lttys -- ignore the field
where
takeIt l1 [] = (Nothing, [])