diff --git a/lib/typeprof/core/ast/method.rb b/lib/typeprof/core/ast/method.rb index 81e1e125..78f1a7e5 100644 --- a/lib/typeprof/core/ast/method.rb +++ b/lib/typeprof/core/ast/method.rb @@ -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 diff --git a/scenario/args/no-keyword.rb b/scenario/args/no-keyword.rb new file mode 100644 index 00000000..6ad9b1a6 --- /dev/null +++ b/scenario/args/no-keyword.rb @@ -0,0 +1,8 @@ +## update +def check(**nil) +end + +## assert +class Object + def check: -> nil +end