4 ms·
Technically the complaint here was of the same record field name in different constructors for the same record, which is perfectly allowed when the fields in qu
by dllthomas 10y ago
Technically the complaint here was of the same record field name in different constructors for the same record, which is perfectly allowed when the fields in question have the same type but not when the types differ. I don't think DuplicateRecordFields addresses this.
- taylorfausak 10y agoThat's correct. {-# LANGUAGE DuplicateRecordFields #-} data A = B { x :: Bool } | C { x :: Int } Example.hs:2:1: error: • Constructors B and C give different types for field ‘x’ • In the data type declaration for ‘A’