Skip to content

Stale error displayed in VScode #1530

Closed
@FrancisToth

Description

@FrancisToth

Hi guys, Haskell noob here. I start playing with VSCode (1.40.2) and Haskell IDE Engine (0.14.0.0) with Haskell Language Server (0.0.31) , and got a really weird behaviour. Given the following code:

module Chap9
    ( 
    )
where

loop3 :: (String, String) -> [String]
loop3 (_, (_ : _)) = loop3 $ ([], [])

foo :: String -> String
foo s = s

If I add another function named like foo

foo :: String -> String
foo s = s

wait for the error to be displayed, and then fix the name of the duplicated function like this:

foo2 :: String -> String
foo2 s = s

the code compiles (when loaded from the terminal) but the editor still shows the stale error telling there are multiple declarations of foo. I do not get the error if the loop3 function is declared like this:

loop3 :: (String, String) -> [String]
loop3 (_, _ : _) = loop3 $ ([], [])

So it looks like the problem comes from pattern matching but I cannot explain why. If this is not the right place to talk about this, I sincerely apologize. In any case, thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: 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