{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NoFieldSelectors #-}
data Error
= FooError { x :: Int }
| BarError { x :: Bool }
These two constructors would be valid in separate data types with the extensions, but not if they’re different constructors in the same data type. Presumably it’s because \(e :: Error) -> e{x = 1} is ambiguous? Wouldn’t it be possible to relax this restriction and only error at the ambiguous call-site instead of at the definition site?