Ticket #71 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Better error message for unimplemented class functions

Reported by: benl Owned by: erikd
Priority: blocker Milestone: 0.1.4
Component: Source Parser Version: 0.1.2
Keywords: Cc:

Description (last modified by benl) (diff)

Added by Jared

The following function fails to compile.

example s = s /= ""

The error message is

ddc: PANIC in Core.Dictionary
        rewriteOverApp: no instance for Class.Eq.Eq (Data.String.String %rTS1)
          in (/=)
                (Data.String.String %rTS1)
                (Data.String.String %rTC0) %rTS0
                (Class.Eq.Eq (Data.String.String %rTS1))
                (Base.Shape2 (Data.String.String %rTS1) (Data.String.String
%rTC0)) s xCS0

Which is the wrong error. There is an instance, but it doesn't provide an implementation for (/=). For the moment, this can be resolved by requiring implementations of all functions in a class.

Change History

Changed 8 years ago by benl

  • description modified (diff)

Changed 8 years ago by benl

  • milestone set to 0.1.4

Changed 8 years ago by benl

We have a instance for /= now, but the error stands. The desugarer should ensure that all instance functions are present. Default definitions in the class definition aren't implemented yet.

Changed 8 years ago by benl

  • component changed from Build System to Source Parser

Changed 8 years ago by benl

  • version set to 0.1.2

Changed 8 years ago by erikd

  • owner set to erikd
  • status changed from new to assigned

The original example no longer fails.

A better example is:

data Foo = Bar | Baz
notBar s = s /= Bar

which currently gives:

ddc: ERROR
    No instance for Class.Eq.Eq (Test.Foo %rTS4)

which as far as I can see is exactly right.

Changed 8 years ago by erikd

  • status changed from assigned to closed
  • resolution set to fixed

Yep, its been fixed.

Thu Nov 12 17:21:59 EST 2009 Erik de Castro Lopo <erikd@…>

  • Bug #71 was fixed in some previous patch, so move the test into the main test suite.
Note: See TracTickets for help on using tickets.