Skip to content

copilot-core: Haddock comment of test property is incorrect #787

Open

Description

@ivanperez-keera

Description

The Haddock comment associated to copilot-core:Test.Copilot.Core.Type.testSimpleTypesInequality indicates that the test is limited because it " [does] not test structs or arrays". However, the implementation of the test does include a struct and an array.

Haddock comments should accurately describe the definitions they accompany.

Type

  • Bug: Incorrect documentation.

Additional context

None.

Requester

  • Ivan Perez.

Method to check presence of bug

Can only be checked by visual inspection, since it is a discrepancy between comments and code. The comment that accompanies copilot-core:Test.Copilot.Core.Type.testSimpleTypesInequality reads:

-- | Test that the function simpleTypes preserves inequality, that is, it
-- returns different values for different types. This test is limited; we do
-- not test structs or arrays.

However, the implementation grabs types from diffTypes, whose last elements are:

    diffTypes = [ simpleType Bool
                  -- ... removed for brevity
                , simpleType (Array Int8 :: Type (Array 3 Int8))
                , simpleType (Struct (S (Field 0) (Field 0)))
                ] 

Expected result

The comment that accompanies copilot-core:Test.Copilot.Core.Type.testSimpleTypesInequality is consistent with what it tests.

Desired result

The comment that accompanies copilot-core:Test.Copilot.Core.Type.testSimpleTypesInequality is consistent with what it tests.

Proposed solution

Remove the claim that the test is limited because we do not test structs or arrays from the Haddock comment for copilot-core:Test.Copilot.Core.Type.testSimpleTypesInequality.

Further notes

None.

Activity

  1. added
    CR:Type:BugAdmin only: Change request pertaining to error detected
    CR:Status:InitiatedAdmin only: Change request that has been initiated
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CR:Status:InitiatedAdmin only: Change request that has been initiatedCR:Type:BugAdmin only: Change request pertaining to error detected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions