Skip to content

Renaming in presence of type errors #3799

Closed
@coot

Description

@coot

Your environment

Which OS do you use?
Fedora
Which version of GHC do you use and how did you install it?
9.6.2 from ghcup
How is your project built (alternative: link to the project)?

Which LSP client (editor/plugin) do you use?
vim+coc.nvim
Which version of HLS do you use and how did you install it?

Have you configured HLS in any way (especially: a hie.yaml file)?
no

Steps to reproduce

Use the following file

module X where

data X a where
  X :: X Int
  Y :: X String
  Z :: X Int

a :: X Int
a = X

-- this doesn't type check on purpose:
instance Eq X where
  (==) = \_ _ -> True

Try to rename the X data type to X'.

Expected behaviour

Either nothing should be changed or everything even in presence of type errors.

Actual behaviour

module X where

data X a where
  X :: X Int
  Y :: X String
  Z :: X Int

a :: X Int
a = X

-- this doesn't type check on purpose:
instance Eq X' where
  (==) = \_ _ -> True

i.e. non of the X occurrences in the defintiion of X or a changed, only its occurrence in the Eq instance.

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-rename-pluginlevel: easyThe issue is suited for beginnerstype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions