Crystal: Linking to another class' initializer

Created on 17 Aug 2019  路  2Comments  路  Source: crystal-lang/crystal

class Foo
  # Hello
  def initialize
  end
end

class Bar < Foo
  # See `Foo.new` or `Foo#new` or `Foo#initialize` or `Foo.initialize`.
  def initialize
    super
  end
end

It seems trying to link to another class' initializer is missing from the generated docs tool.

image

bug topicdocs-generator

Most helpful comment

@edwinacunav the issue is not about running the exemple, but about the generated documentation. Writting Foo.bar for exemple would create a link to the documentation of Foo.bar, and it doesn't work for Foo.new, hence this issue.

All 2 comments

class Foo
  # Hello
  def initialize
    puts "I'm Foo!"
  end
end

class Bar < Foo
  # See `Foo.new` or `Foo#new` or `Foo#initialize` or `Foo.initialize`.
  def initialize
    super
    puts "OK! OK! I'm Bar!"
  end
end

Foo.new
Bar.new

It's weird because I was able to compile it and run my ./foobar binary without any issues. O_O

I'm Foo!
I'm Foo!
OK! OK! I'm Bar!

@edwinacunav the issue is not about running the exemple, but about the generated documentation. Writting Foo.bar for exemple would create a link to the documentation of Foo.bar, and it doesn't work for Foo.new, hence this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RX14 picture RX14  路  3Comments

relonger picture relonger  路  3Comments

pbrusco picture pbrusco  路  3Comments

lgphp picture lgphp  路  3Comments

asterite picture asterite  路  3Comments