Closed
Description
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.