-
Notifications
You must be signed in to change notification settings - Fork 72
Description
Description
The function Copilot.Core.Type.Uninitialized.uninitialized was deprecated in Copilot 3.6. The function was incomplete, and it was only used in one example, so what was needed from it was moved directly there.
As per our internal policy of waiting 3 versions from deprecation until a public interface declaration can be removed, this type can now be removed completely. Since it is the only definition in the module Copilot.Core.Type.Uninitialized, the whole module can be removed.
Type
- Bug: unused code included in the implementation.
Additional context
Requester
- Ivan Perez
Method to check presence of bug
The following expression finds imports of the module Uninitialized, ignoring appearances in comments or strings.
$ grep -nHre 'Uninitialized' --include='*.hs' | grep -ve '^{-#' | grep -ve '--.*Uninitialized' | grep -ve '"[^"]*Uninitialized[^"]*"'
copilot-core/src/Copilot/Core/Type/Uninitialized.hs:10:module Copilot.Core.Type.Uninitialized
copilot-core/src/Copilot/Core.hs:33: , module Copilot.Core.Type.Uninitialized
copilot-core/src/Copilot/Core.hs:45:import Copilot.Core.Type.UninitializedWe use the module and not the function because a function with the same name is used in an example.
The result obtained are three lines: the module, its re-import from Copilot.Core, and it being exported. The function uninitliaized is not required by Copilot's requirements, and therefore should not be published.
Expected result
The string should be either empty (module is not used) or list further uses (e.g., in other parts of Copilot).
Desired result
The string returned by the command above should be empty.
Proposed solution
Removing the module Copilot.Core.Type.Uninitialized, as well as its declaration from the cabal package, and its re-export from Copilot.Core.
Further notes
See a72543d for a confirmation of when the type was deprecated.