Less scary arity mismatch error message when deriving
ClosedPublic

Authored by mniip on Aug 27 2016, 9:50 PM.

Details

Summary

When deriving an instance, check the arity of the thing given in the deriving clause and produce a less scary-looking message if the arity is wrong.

Test Plan

Corrected a few tests to include the new message.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mniip updated this revision to Diff 8499.Aug 27 2016, 9:50 PM
mniip retitled this revision from to Less scary arity mismatch error message when deriving.
mniip updated this object.
mniip edited the test plan for this revision. (Show Details)
mniip updated the Trac tickets for this revision.
thomie added inline comments.Aug 28 2016, 5:50 PM
compiler/typecheck/TcDeriv.hs
1312
bgamari added inline comments.Aug 29 2016, 2:14 PM
compiler/typecheck/TcDeriv.hs
1312

Today I learned.

That being said, I wonder if we should say more here. "a is not a unary constraint" is a true statement, but it doesn't really explain what the /problem/ is. Perhaps "a is not a unary constraint, as expected in a deriving clause" or something to that effect?

mniip updated this revision to Diff 8564.Aug 31 2016, 4:39 AM
mniip edited edge metadata.

Fix spleeing error

bgamari requested changes to this revision.Aug 31 2016, 2:21 PM
bgamari edited edge metadata.

Alright, looks reasonable to me although according to Harbormaster you need to update the expected outtput from test T12531.

This revision now requires changes to proceed.Aug 31 2016, 2:21 PM
mniip updated this revision to Diff 8608.Sep 1 2016, 9:36 AM
mniip edited edge metadata.

rebase

bgamari accepted this revision.Sep 2 2016, 6:47 AM
bgamari edited edge metadata.

Alright, it looks like that did the trick; the parsing001 failure is explainable.

Thanks @mniip!

This revision is now accepted and ready to land.Sep 2 2016, 6:47 AM
This revision was automatically updated to reflect the committed changes.