Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/rbs/prototype/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def method_type(method)
name or raise
optional_keywords[name] = Types::Function::Param.new(name: nil, type: untyped)
when :keyrest
rest_keywords = Types::Function::Param.new(name: nil, type: untyped)
name = nil if name == :** # For `def f(...) end` syntax
rest_keywords = Types::Function::Param.new(name: name, type: untyped)
when :block
block = Types::Block.new(
type: Types::Function.empty(untyped).update(rest_positionals: Types::Function::Param.new(name: nil, type: untyped)),
Expand Down
4 changes: 2 additions & 2 deletions test/rbs/runtime_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.baz: () { (*untyped) -> untyped } -> untyped

alias bar foo

def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped) -> untyped
def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped d) -> untyped

private

Expand Down Expand Up @@ -148,7 +148,7 @@ def self.baz: () { (*untyped) -> untyped } -> untyped

alias bar foo

def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped) -> untyped
def foo: (untyped foo, ?untyped bar, *untyped baz, untyped a, b: untyped, ?c: untyped, **untyped d) -> untyped

private

Expand Down
Loading