Skip to content

In doc generation, #methodname(ArgType) can link to the wrong implementation if the arg count is the same #16499

@jneen

Description

@jneen

Bug Report

class A
  # see `#foo(String)`
  def bar
  end

  def foo(x : Int)
  end

  def foo(x : String)
  end
end

Generates the following html under crystal docs (snipped):

<p>see <code><a href="A.html#foo%28x%3AInt%29-instance-method">#foo(String)</a></code></p>

This is linking to #foo(Int) instead of #foo(String) because it happens to be first.

Implementing overload detection like this might be a bit of a lift though - it doesn't look like argument type information is passed into Crystal::Type#lookup_method at any point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions