Include field type in missing field error message
Motivation
I'm working on some code that hasn't been touched in a while (cough test suite *cough), and a lot of types have been updated with new fields and changed fields. So all of the record creation stuff needs addressing.
An example error message is:
lumi-mojo > /home/matt/Projects/lumi/mojo/common/test/Lumi/Gen/Schema/Quote.hs:85:20: error:
lumi-mojo > • Constructor ‘QuoteVariant’ does not have the required strict field(s): quoteVariantCloneDescription
lumi-mojo > • In the expression:
lumi-mojo > QuoteVariant
So I'll throw in the line:
, quoteVariantThing = Nothing
+ , quoteVariantCloneDescription = ""
}
But this isn't right! quoteVariantCloneDescription
has the type Maybe Text
. So I need to go through and do another edit:
, quoteVariantThing = Nothing
- , quoteVariantCloneDescription = ""
+ , quoteVariantCloneDescription = Nothing
}
Proposal
This minor inconvenience can easily be fixed by supplying the type of the missing field.
/home/matt/Projects/lumi/mojo/common/test/Lumi/Gen/Schema/Quote.hs:85:20: error:
- • Constructor ‘QuoteVariant’ does not have the required strict field(s): quoteVariantCloneDescription
+ • Constructor ‘QuoteVariant’ does not have the required strict field(s): quoteVariantCloneDescription :: Maybe Text
• In the expression:
QuoteVariant