Skip to content

copilot-core: Remove deprecated functions in Copilot.Core.Type and Copilot.Core.Type.Array #500

@ivanperez-keera

Description

@ivanperez-keera

Description

The functions Copilot.Core.Type.typename, Copilot.Core.Type.tylength, Copilot.Core.Type.tysize, Copilot.Core.Type.fieldname, Copilot.Core.Type.accessorname and Copilot.Core.Type.Array.arrayelems are not being used by any other part of Copilot.

They were replaced by functions with similar names in lowerCamelCase format. The original functions were deprecated in Copilot 3.17 and no messages have been received requesting that they be kept in this library.

As per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, these functions can now be removed.

Type

  • Bug: unused code included in the implementation.

Additional context

Requester

  • Ivan Perez

Method to check presence of bug

There is no easy, forwards-compatible, automated way of detecting that the functions are present and also deprecated. Manual inspection is recommended. At present, they are the only deprecated functions in copilot-core, so their presence can be found with:

$ grep -nHre 'DEPRECATED' src/
src/Copilot/Core/Type.hs:58:-- {-# DEPRECATED typename "Use typeName instead." #-}
src/Copilot/Core/Type.hs:85:-- {-# DEPRECATED fieldname "Use fieldName instead." #-}
src/Copilot/Core/Type.hs:96:-- {-# DEPRECATED accessorname "Use accessorName instead." #-}
src/Copilot/Core/Type.hs:139:-- {-# DEPRECATED tylength "Use typeLength instead." #-}
src/Copilot/Core/Type.hs:149:-- {-# DEPRECATED tysize "Use typeSize instead." #-}
src/Copilot/Core/Type/Array.hs:47:{-# DEPRECATED arrayelems "Use ArrayElems instead." #-}

Expected result

The strings returned by the command above should be empty (nothing is deprecated).

Desired result

The strings returned by the command above should be empty (nothing is deprecated).

Proposed solution

Remove the deprecated functions from Copilot.Core.Type and Copilot.Core.Type.Array.

Further notes

None.

Metadata

Metadata

Labels

CR:Status:ClosedAdmin only: Change request that has been completedCR:Type:BugAdmin only: Change request pertaining to error detected

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions