Skip to content

Lint should say when it is checking a rule

Ben Price requested to merge brprice/ghc:WIP/lint-rule into master

Clarify location of lint errors which occur in rules. I.e. actually tell the user that the error was in a rule. It is rather confusing to be told that your plugin is creating bad core because some variable is not in scope when that variable does not occur in the dumped core (with certian -dsuppress... options)!

In the future, it may be nice to change the reporting so the rule and unfolding are not considered to be within the RHS. Perhaps some of the other error cases in lintSingleBinding should be moved out of "RHS" also. (Or my reading of "RHS" is wrong: roughly "that which comes after the =")

These seem to be properties of the binder, independent of its definition

  • levity-polymorphism
  • join points have valid types
  • loop breakers are not INLINE
  • arity checks

and maybe also these which seem to be properties of the binder-plus-definition, rather than contained in the RHS

  • let/app
  • rec & top level are not demanded

Merge request reports