Skip to content

Wrong Conflicting definitions error #175

Closed
@sir4ur0n

Description

@sir4ur0n

Hi,

We are considering migrating to HLS for our project, but we surprisingly get some typecheck errors, while Stack compilation works just fine.

The first problem we encounter is about conflicting definitions.

I tried to pull together a minimal reproducing repo: https://github.com/Sir4ur0n/hls-bug-conflicting-definitions

Everything you need (Stack, HLS) is provided by shell.nix (though build may be long), but the bug remains with traditional Stack + HLS installations (tested on a coworker Macbook).

  • stack build works fine
  • haskell-language-server gives a typecheck error:
File:     /home/sir4ur0n/sandbox/foobar/src/BugHLS.hs
Hidden:   no
Range:    8:0-8:14
Source:   typecheck
Severity: DsError
Message: 
  Conflicting definitions for ‘a_a28B’
  Bound at: /home/sir4ur0n/sandbox/foobar/src/BugHLS.hs:8:1-14
  /home/sir4ur0n/sandbox/foobar/src/BugHLS.hs:8:1-14
Files that failed:
 * /home/sir4ur0n/sandbox/foobar/src/BugHLS.hs

Even more surprising, the 2 paths are exactly the same, even the character ranges.

Note, we use some extensions in this breaking piece of code

This was tested with HLS 8.8.3 as we use Stack snapshot lts-15.15 which relies on GHC 8.8.3.

I suspect this has to do with TemplateHaskell, but AFAIU HLS should support such code.

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    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