Copilot-Language / copilot

A stream-based runtime-verification framework for generating hard real-time C code.
http://copilot-language.github.io
618 stars 49 forks source link

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

Closed ivanperez-keera closed 3 months ago

ivanperez-keera commented 3 months ago

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

Additional context

Requester

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.

ivanperez-keera commented 3 months ago

Change Manager: Confirmed that the issue exists.

ivanperez-keera commented 3 months ago

Technical Lead: Confirmed that the issue should be addressed.

ivanperez-keera commented 3 months ago

Technical Lead: Issue scheduled for fixing in Copilot 3.19.

Fix assigned to: @ivanperez-keera .

ivanperez-keera commented 3 months ago

Implementor: Solution implemented, review requested.

ivanperez-keera commented 3 months ago

Change Manager: Verified that:

ivanperez-keera commented 3 months ago

Change Manager: Implementation ready to be merged.