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

Issue with the "in" method argument #128

Closed
pointlessone opened this issue Mar 30, 2020 · 2 comments
Closed

Issue with the "in" method argument #128

pointlessone opened this issue Mar 30, 2020 · 2 comments

Comments

@pointlessone
Copy link

Steep has issues with method arguments named "in". I'm getting the following error during check:

parse error on value: #<Ruby::Signature::Parser::LocatedValue:0x00007ff7fe905558 @location=#<Ruby::Signature::Location:1960 @buffer=example.rbs, @pos=27...29, source='in', start_line=2, start_column=13>, @value=:in> (kIN)

The code is:

class Example
  def test(in:)
  end
end

I'm using rbs prototype to generate signatures. Here's the generated signature:

class Example
  def test: (in: untyped `in`) -> untyped
end

Full example can be downloaded from gist.

This is a minimal example but I have this issue with Rails (ActiveModel validations to be specific) signatures.

I use Steep 0.14.0.

@meganemura
Copy link
Contributor

It doesn't seem to be reproduced this problem now, so I think we can close this issue.
https://github.com/meganemura/steep-sandbox/tree/master/issue-128

$ bundle exec steep version
0.17.1
$ bundle exec steep check --log-level=info
[Steep 0.17.1] [target=issue] Adding source file: reproduce1.rb
[Steep 0.17.1] [target=issue] Adding signature file: sig/reproduce1.rbs
[Steep 0.17.1] [target=issue] [target#type_check(target_sources: [reproduce1.rb], validate_signatures: true)] type checking 1 files took 0.001387 seconds
[Steep 0.17.1] [target=issue] [target#type_check(target_sources: [reproduce1.rb], validate_signatures: true)] load signature and type check took 6.218247 seconds
[Steep 0.17.1] No type error found

@soutaro
Copy link
Owner

soutaro commented Jul 6, 2020

Thanks! It was a parsing problem and seems like fixed in ruby/rbs#307 (without any intention to fix this issue...)

@soutaro soutaro closed this as completed Jul 6, 2020
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

No branches or pull requests

3 participants