Skip to content

Compile error suppression #12

@JulianBirch

Description

@JulianBirch

If I create a test file with an error in it and then add a property, I get an error like this:

test/Properties.hs:14:10:
    Not in scope: ‘prop_analyzeReturnsSameForEquals’
    In the splice: $defaultMainGenerator

If I remove the property, I get this error:

test/Properties.hs:32:20:
    Expecting one more argument to ‘TestValues’
    The first argument of ‘Arbitrary’ should have kind ‘*’,
      but ‘TestValues’ has kind ‘* -> *’
    In the instance declaration for ‘Arbitrary TestValues’

So, $defaultMainGenerator suppresses the error messages that are really causing the problem. I've figured out that you can resolve this problem by placing $defaultMainGenerator at the bottom of the file.

Would it be possible to figure out a way to prevent $defaultMainGenerator from causing this problem, or should the documentation be updated to recommend declaring main at the bottom of the file? (I could supply a PR for the second, the first is rather beyond my ability RN.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions