-
-
Notifications
You must be signed in to change notification settings - Fork 412
Description
I have a "library" component with a module Src with this code:
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
module Src where
import Data.Singletons (Sing)
import Data.Vinyl.TypeLevel (Nat(..))
data X (n :: Nat)
type instance Sing = XThis compiles fine with GHC 8.8.3+cabal or stack+lts15.7.
When I first start vscode with ghcide, ghcide reports no errors in this file, as expected.
Now, if I do these steps, ghcide will suddenly start reporting an error.
- start vscode
- open
Srcmodule from the library component andTestmodule from thetest-suitecomponent (this will force ghcide to load both components) - switch between the two files a few times, while typing and deleting some gibberish
- eventually, ghcide will report this error:
Conflicting family instance declarations:
Sing = X -- Defined at /home/dc/dev/ghcide-tyfam/src/Src.hs:9:15
Sing = X -- Defined in module Src
Sometimes you may have to repeat step 3 a few times, sometimes it happens on the first try.
I've recorded a short screencast to better illustrate how to reproduce this:
https://drive.google.com/file/d/1z3BkMHuu2NemDUar1GA4C2y1OD9Cgmzk/view?usp=sharing
I've also uploaded the repo I used to reproduce this and to record the screencast:
https://github.com/dcastro/ghcide-tyfam
Things I've noticed:
- I cannot reproduce this with haskell-ide-engine
- I cannot reproduce this if both modules (
SrcandTestin this case) are part of the same component
I've compiled ghcide against ghc 8.8.3, like so:
stack install --stack-yaml stack883.yaml
where stack883.yaml is:
# resolver: nightly-2020-02-13
resolver: lts-15.7
packages:
- .
extra-deps:
- haskell-lsp-0.22.0.0
- haskell-lsp-types-0.22.0.0
- lsp-test-0.11.0.2
- ghc-check-0.5.0.1
- hie-bios-0.5.0
- extra-1.7.2
nix:
packages: [zlib]
GHC: 8.8.3
Ghcide: v0.2.0 or master