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

add lexer/token/type.rbs #114

Merged
merged 1 commit into from
Oct 12, 2023
Merged

Conversation

Little-Rubyist
Copy link
Contributor

I was planning to type-check symbol.rb, but I realized that I need grammar.rb, lexer/token.rb, and lexer/token/type.rb.
I'm working on preparing them in order, and this is going to be the first step in that process.

@yui-knk
Copy link
Collaborator

yui-knk commented Oct 12, 2023

LGTM! Thank you!

@yui-knk yui-knk merged commit 4c715a8 into ruby:master Oct 12, 2023
11 checks passed
attr_accessor type: Type
attr_accessor s_value: String
attr_accessor alias: String
attr_accessor keyword_init: bool
Copy link
Collaborator

@yui-knk yui-knk Oct 12, 2023

Choose a reason for hiding this comment

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

keyword_init of Struct.new doesn't define keyword_init accessor on the class it creates, I noticed it after merge.
Could you remove this type definition when you have chance?

>> s = Struce.new(:a, keyword_init: true)
>> s.new(a: 1).a
=> 1
>> s.new(a: 1).keyword_init
(irb):6:in `<main>': undefined method `keyword_init' for an instance of #<Class:0x0000000105b9df38>(keyword_init: true) (NoMethodError)

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.

2 participants