Opened 9 years ago

Closed 7 years ago

#155 closed defect (wontfix)

PANIC "mergeClasses: classes have differing kinds" in my Hashtable first cut

Reported by: blackh Owned by: benl
Priority: normal Milestone:
Component: Source Type Inferencer Version: 0.1.2
Keywords: Cc:

Description

[1 of 1] Compiling Hashtable
ddc: PANIC in Type.Squid.Class
        mergeClasses: classes have differing kinds
            cids = [720, 721]
            ks   = [*, * -> *]
        
        Please report this bug to the maintainers at:
            http://trac.haskell.org/ddc
            or by emailing disciple-cafe@googlegroups.com

Attachments (2)

Hashtable.ds (1.1 KB) - added by blackh 9 years ago.
Test.ds (887 bytes) - added by benl 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by blackh

comment:1 Changed 9 years ago by benl

  • Owner set to benl
  • Status changed from new to assigned

Changing the hashtable function to the following works. The original version missed the value to initialise the array elements [] in this case.

hashtable_new :: (k -> Int) -> Int -> Hashtable k v
hashtable_new hash capacity = Hashtable hash (array_new capacity [])

However, the following gives the same error message:

hashtable_new :: (k -> Int) -> Int -> Hashtable k v
hashtable_new hash capacity = Hashtable hash (new&{Array} capacity [])

So it looks like the projection new&{Array} isn't being managed properly.

comment:2 Changed 9 years ago by benl

  • Milestone set to 0.1.3
  • Priority changed from normal to blocker

comment:3 Changed 8 years ago by benl

The original panic has been fixed, but the elaborator doesn't yet add effect and closure variables to algebraic data types containing functions. It works if you add them explicitly.

data Hashtable !e1 $c1 k v = Hashtable {
        hash    :: k -(!e1 $c1)> Int;
	entries :: Array (List (Entry k v))
    }

There was also a missing [] initialiser in the hashtable_new function.

I'm leaving this open as an nice example of why the elaborator needs to be improved.

Changed 8 years ago by benl

comment:4 Changed 7 years ago by benl

  • Milestone 0.1.3 deleted
  • Priority changed from blocker to normal

comment:5 Changed 7 years ago by benl

  • Component changed from Core Type Checker to Source Type Inferencer

comment:6 Changed 7 years ago by benl

  • Resolution set to wontfix
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.