Ticket #1446 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

-fallow-incoherent-instances suggested when already used

Reported by: iampure@… Owned by: simonpj
Priority: normal Milestone: 6.8.1
Component: Compiler Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

This is essentially the same issue as with the monomorphism restriction, but then for another flag.

Change History

Changed 6 years ago by simonpj

Please give a repo case. Otherwise nothing will happen!

Simom

Changed 6 years ago by guest

I've seen this too, unfortunately I can't send the code that produced this error as I gave up in despair and deleted it. But the problem is real.

Adrian Hey

Changed 6 years ago by guest

I thought I should add a bit more detail about this. I saw it with Windows ghc 6.6.1 FWIW. The scenario is you write some code which won't compile (ghc giving an error message suggesting using this flag will fix the problem). You recompile with this flag and get exactly the same error message. There are 2 things wrong with this IMO:

1- (Ideally) ghc should not advise the use of a flag unless it really will fix the immediate problem.

2- It should not give an error message advising the use of a flag which has already been used.

The current behaviour leaves the user (me in this case) wondering if the compiler really knows what it's talking about and whether there really is a problem in the code or if this is a *real* bug in the compiler (rather than just bad choice of error messages).

Adrian Hey

Changed 6 years ago by simonpj

I think this one is correct. You have to use -fallow-incoherent-instances when compiling the instance declarations, not in the client module that uses them. This is supposed to be a feature: the library writer can control instances individually.

I'll clarify the error message though. Thanks.

Simon

Changed 6 years ago by igloo

  • owner set to simonpj
  • milestone set to 6.8

Changed 6 years ago by simonpj

  • status changed from new to closed
  • resolution set to invalid

The error message now says:

  To pick the first instance above, use -fallow-incoherent-instances
  when compiling the other instance declarations

I hope that makes it clear why the message appears even though -fallow-incoherent-instances is set for the module that is actually being compiled.

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.