Skip to content
New issue

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

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

Already on GitHub? # to your account

Add constant type for rbs #130

Merged
merged 1 commit into from
Mar 21, 2021

Conversation

shoma07
Copy link
Contributor

@shoma07 shoma07 commented Mar 21, 2021

In this PR, add type definition(rbs) to constant using @return.
If there is no @return, it continue to be untyped.

We can also write @return in constant, but I'm not sure if that's the right thing to do.
But I couldn't think of any other way to add the type.

example:

  • ruby
    class A
      # @return [String]
      EXAMPLE_CONSTANT = 'Bar'
    end
  • rbs
    class A
      EXAMPLE_CONSTANT: String
    end

I haven't changed rbi, so I couldn't determine if #128 could be closed.

@shoma07 shoma07 marked this pull request as ready for review March 21, 2021 14:41
@AaronC81
Copy link
Owner

Awesome - thanks for your contribution! Looks good to me.

Yeah, I think we'll leave #128 open for now until RBI works too.

@AaronC81 AaronC81 merged commit 97c28d6 into AaronC81:master Mar 21, 2021
@AaronC81 AaronC81 mentioned this pull request Mar 21, 2021
@shoma07
Copy link
Contributor Author

shoma07 commented Mar 23, 2021

Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants