Skip to content

Bug: lib typedefs are indistinguishable #16695

@straight-shoota

Description

@straight-shoota

When using a lib type as generic argument, it seems that different types referencing the same base type are considered identical.
This would be expected for alias, but not for type where each definition is a distinct type.

lib LibFoo
  type A = Void
  type B = Void
end

class Bar(T)
  def bar
    T
  end
end

Bar(LibFoo::A).new.bar # => LibFoo::A
Bar(LibFoo::B).new.bar # => LibFoo::A

In the interpreter it works fine (the second call returns LibFoo::A), so this looks like a codegen bug.

Originally discovered in #16686


Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugA bug in the code. Does not apply to documentation, specs, etc.topic:compiler:codegen

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions