Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#71 closed defect (fixed)

Better error message for unimplemented class functions

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

Description (last modified by benl)

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 (8)

comment:1 Changed 10 years ago by benl

  • Description modified (diff)

comment:2 Changed 10 years ago by benl

  • Milestone set to 0.1.4

comment:3 Changed 10 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.

comment:4 Changed 10 years ago by benl

  • Component changed from Build System to Source Parser

comment:5 Changed 10 years ago by benl

  • Version set to 0.1.2

comment:6 Changed 10 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.

comment:7 Changed 10 years ago by erikd

  • Resolution set to fixed
  • Status changed from assigned to closed

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.

comment:8 Changed 7 years ago by benl

  • Milestone 0.1.4 deleted

Milestone 0.1.4 deleted

Note: See TracTickets for help on using tickets.