Opened 11 years ago

Closed 7 years ago

#44 closed defect (wontfix)

Fix elaboration of recursive data types.

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


At the moment, data type definitions to be elaborated must be in-order and not recursive. For example:

data Foo a 
  = FooInt Int

data Bar a 
  = BarFoo Foo

The definition for Bar must come after def for Foo, otherwise Source.Desugar won't have the correct kind for it. Should probably tie this elaboration to kind inference.

Change History (4)

comment:1 Changed 11 years ago by benl

If we put them the other way around

data Bar a 
  = BarFoo Foo

data Foo a 
  = FooInt Int

Then we get an silent, malkinded type expression in the .di file.

data Bar %rDK3 a
        = BarFoo {
                Main.Foo %rDK3;   <--- bad kind

data Foo %rDK4 a
        = FooInt {
                Base.Int32 %rDK4;

Test is T44-DataTypeOrder

comment:2 Changed 10 years ago by benl

  • Summary changed from Redo data type elaboration and kind inference. to Fix elaboration of recursive data types.
  • Type changed from task to defect

comment:3 Changed 8 years ago by benl

  • Priority changed from project to normal

comment:4 Changed 7 years ago by benl

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