Skip to content

Commit

Permalink
Ignore "**nil"
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Aug 9, 2024
1 parent d4268c5 commit dffb768
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/typeprof/core/ast/method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,15 @@ def self.parse_params(tbl, raw_args, lenv)
end
end

if raw_args.keyword_rest
rest_keywords = raw_args.keyword_rest.name
case raw_args.keyword_rest
when Prism::KeywordRestParameterNode
rest_keywords = raw_args.keyword_rest.name if raw_args.keyword_rest
when Prism::NoKeywordsParameterNode
# what to do?
when nil
# nothing to do
else
raise "unexpected keyword rest: #{ raw_args.keyword_rest.class }"
end

block = raw_args.block.name if raw_args.block
Expand Down
8 changes: 8 additions & 0 deletions scenario/args/no-keyword.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## update
def check(**nil)
end

## assert
class Object
def check: -> nil
end

0 comments on commit dffb768

Please sign in to comment.