Skip to content

Bogus "Duplicate instance declarations:" error #3237

Closed
@mouse07410

Description

@mouse07410

Your environment

  • MacOS Monterey 12.6 with Xcode-14
  • GHC-9.4.2
  • Cabal-3.8.1.0
  • HLS 1.8.0.0 installed via ghcup
  • hlint v3.4.1
  • VS Code 1.71.2 with vscode-haskell (Haskell for VIsual Studio Code) v2.2.1

Steps to reproduce and Actual behavior

At some point in time, HLS complains about "Duplicate instance declarations" which don't make sense because both refer to the same definition - same file and line number (aka, the same place).

Here's an example:

Duplicate instance declarations:
  instance Functor Point3D
     -- Defined at /Users/ur20980/src/stepic-tests/src/Lib.hs:523:10
  instance Functor Point3D
     -- Defined at /Users/ur20980/src/stepic-tests/src/Lib.hs:523:10  typecheck

Expected behaviour

Understand that one entry in one file is not a duplicate of itself?

Debug information

This is an intermittent problem. Usually it clears up when I restart HLS within VS Code (don't even need to restart VS Code itself).

Metadata

Metadata

Assignees

No one assigned

    Labels

    multi-componentIssues relating to multi-component supportstatus: blockedNot actionable, because blocked by upstream/GHC etc.type: 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