haskell-mode icon indicating copy to clipboard operation
haskell-mode copied to clipboard

:set +c makes all warnings appear twice, breaking some functionality

Open Ptival opened this issue 7 years ago • 5 comments

I'm not sure why nobody noticed this, but for me, the :set +c has the bad side-effect of producing this:

<-  [-Wunused-imports]
       The import of ‘Data.Typeable’ is redundant
         except perhaps to import instances from ‘Data.Typeable’
       To import instances alone, use: import Data.Typeable()
   Ok, modules loaded: Variable.
   Collecting type info for 1 module(s) ... 
   
   /home/ptival/chick/lib/Term/Variable.hs:18:1-20: warning: [-Wunused-imports]
       The import of ‘Data.Typeable’ is redundant
         except perhaps to import instances from ‘Data.Typeable’
       To import instances alone, use: import Data.Typeable()

That is, it seems warnings are emitted once when type-checking, then once more when colllecting type information.

This has the bad side effect that features like "removing redundant imports" ask me to remove each import twice!

Ptival avatar May 03 '17 00:05 Ptival

I had wondered why many errors were reported twice, but never bothered to dig into why! Thanks!

ivan-m avatar May 03 '17 01:05 ivan-m

Confirm, same behavior.

Pitometsu avatar Nov 23 '17 17:11 Pitometsu

I see double warnings even with removed "+c".

vlatkoB avatar Nov 25 '17 11:11 vlatkoB

I can confirm that I also see double warnings. Unsetting "+c" by writing :unset +c in the REPL buffer resolves the problem.

ulrikrasmussen avatar Dec 03 '17 06:12 ulrikrasmussen

Is there a way to set it automatically? I tried setting

(haskell-interactive-set-+c nil)

but to no avail.

vlatkoB avatar Apr 07 '18 10:04 vlatkoB