Ticket #4174 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Jumbled error message from type family operator

Reported by: lilac Owned by:
Priority: normal Milestone: 7.0.1
Component: Compiler (Type checker) Version: 6.12.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Difficulty:
Test Case: indexed-types/should_fail/T4174 Blocked By:
Blocking: Related Tickets:

Description

The attached file produces this error message:

Testcase.hs:82:0:
    Couldn't match expected type `True'
           against inferred type `Main.R::<=:GHC6'10GHC6'8 Minor1 minor'
    When generalising the type(s) for `testcase'

That should say

[...] against inferred type `GHC6'10 Minor1 :<=: GHC6'8 minor'

Apologies for the complexity of the testcase; simpler testcases seem to not reproduce the problem.

Attachments

Testcase.hs Download (0.9 KB) - added by lilac 3 years ago.
Testcase reproducing bad error message

Change History

Changed 3 years ago by lilac

Testcase reproducing bad error message

Changed 3 years ago by simonpj

I agree. Thank you for the test case. Will look at it when the new type inference machinery is done. Weeks not months I hope.

Simon

Changed 3 years ago by igloo

  • blockedby 4232 added
  • milestone set to 6.14.1

Changed 3 years ago by igloo

  • blockedby 4232 removed

Changed 3 years ago by simonpj

  • status changed from new to closed
  • testcase set to indexed-types/should_fail/T4174
  • resolution set to fixed

This bug is fixed by the latest wave of typechecker fixes (I'm not sure exactly which one). Now we get these errors:

T4174.hs:42:12:
    Couldn't match type `False' with `True'
    Expected type: True
      Actual type: GHC6'10 Minor1 :<=: GHCVersion (WayOf m)
    In the expression: sync_large_objects
    In an equation for `testcase': testcase = sync_large_objects

T4174.hs:42:12:
    Could not deduce (a ~ SmStep) from the context (Monad m)
      `a' is a rigid type variable bound by
          the type signature for `testcase' at T4174.hs:41:60
    In the expression: sync_large_objects
    In an equation for `testcase': testcase = sync_large_objects

T4174.hs:42:12:
    Could not deduce (b ~ RtsSpinLock) from the context (Monad m)
      `b' is a rigid type variable bound by
          the type signature for `testcase' at T4174.hs:41:62
    In the expression: sync_large_objects
    In an equation for `testcase': testcase = sync_large_objects

T4174.hs:42:12:
    Could not deduce (p ~ True) from the context (Monad m)
      `p' is a rigid type variable bound by
          the type signature for `testcase' at T4174.hs:41:57
    Expected type: True
      Actual type: Threaded (WayOf m)
    In the expression: sync_large_objects
    In an equation for `testcase': testcase = sync_large_objects

The first of these is the one you were after, and looks quite reasonable.

I've added a regression test.

Thanks for reporting it!

Simon

Note: See TracTickets for help on using tickets.