copilot
copilot copied to clipboard
`copilot-core`: `InnerType`, `Flatten`, `Foldable` instance, `size` are unnecessary in `Array` module
Description
Multiple definitions in Copilot.Core.Type.Array
are not being used by any other part of Copilot or, as far as we know, by any user of Copilot. These include the InnerType
class, the Flatten
class, the Foldable
instance, and the size
function. They are not necessary parts of the interface to use Copilot, and not required by Copilot's requirements.
Therefore, it would be suitable to remove those definitions from the module.
As per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, those definitions should be deprecated.
Type
- Bug: unused code included in the implementation.
Additional context
None.
Requester
- Ivan Perez
Method to check presence of bug
The classes are mentioned in several functions, but removing them does not change the behavior. Due to the generic names of some functions (e.g., size
), we cannot use grep to detect that they are not used.
The result obtained is just the module declaration.
Removing the following elements altogether, the code compiles without errors and behaves in the same way:
-
Copilot.Core.Type.Array
-
InnerType
-
Flatten
-
Foldable
-
size
-
Expected result
The following elements are deprecated:
-
Copilot.Core.Type.Array
-
InnerType
-
Flatten
-
Foldable
-
size
-
Desired result
The following elements are deprecated:
-
Copilot.Core.Type.Array
-
InnerType
-
Flatten
-
Foldable
-
size
-
Proposed solution
Deprecate the following definitions:
-
Copilot.Core.Type.Array
-
InnerType
-
Flatten
-
Foldable
-
size
-
Further notes
None.