Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc of the type having generic superclass #3617

Merged

Conversation

makenowjust
Copy link
Contributor

For example, Channel::Buffered's doc:

2016-12-01 14 37 18

I fixed it to:

2016-12-01 17 17 32

@makenowjust
Copy link
Contributor Author

#3616 is related problem, I know. Because two problems are occurred by same lines:

    when GenericInstanceType
      type.type_vars

It is just a bug because GenericInstanceType#type_vars returns no Array(String) but Hash(String, ASTNode)

I think we should not use Type#full_name for instance type because we already have nearly same processes such like GenericInstanceType#to_s_with_options and Type#type_to_html for GenericInstanceType. Type#full_name should only use for the title of doc page.

@asterite
Copy link
Member

asterite commented Dec 1, 2016

@makenowjust Looks good! Just make sure that the file is properly formatted :-)

generic_type.full_name_without_type_vars(io)
if not_instantiated
io << '('
type.type_vars.values.join(", ") { |type_var| type_var.as(Var).type.to_s io }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could that be shortened to type.type_vars.values.join ", ", &.as(Var).type.to_s(io)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I fixed it.

@makenowjust
Copy link
Contributor Author

@asterite Sorry, I missed crystal tool format.

@asterite
Copy link
Member

asterite commented Dec 3, 2016

@makenowjust Thank you! 💙

@asterite asterite merged commit 46a5372 into crystal-lang:master Dec 3, 2016
@makenowjust makenowjust deleted the fix/doc/superclass-list-bug branch December 4, 2016 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants