Skip to content

Unification bug with recursive types and unions #11

@asterite

Description

@asterite
generic class Entry
  def next=(n)
    @next = n
  end

  def next
    @next
  end
end

entry1 = Entry.new
entry1.next = entry1

entry2 = Entry.new
entry2.next = entry1
entry2.next = entry2

union = entry1
union = entry2

union.next

The type inference gives two Entry classes, but only one should exist, that has @next pointing to itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions