Skip to content

Commit 5897241

Browse files
committed
Let the private parser entry points enable forwarding parameters
Gating `(...)` behind a C-level option left the enabled path with no test coverage from Ruby, where the whole suite lives. Without it the forwarding branch of `parse_params`, its AST translation, and its serialization would be free to rot until the semantics are settled. Thread the option through the private `_parse_method_type` and `_parse_signature` entry points (and their `_to_bytes` variants), which tests already call directly. The public `RBS::Parser` API keeps passing `false`, so signatures written for the gem still can't use the syntax. This also strengthens the restriction tests: they used to pass simply because the gate rejected `(...)` outright, and now run with the option enabled, so they check the grammar restrictions they name. The WebAssembly parser has no way to enable the option, so its shim raises `NotImplementedError` rather than quietly parsing without it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015bgoC4byczqmYRzNrDkVrL
1 parent 43654b3 commit 5897241

8 files changed

Lines changed: 121 additions & 52 deletions

File tree

ext/rbs_extension/main.c

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,16 @@ static rbs_lexer_t *alloc_lexer_from_buffer(rbs_allocator_t *allocator, VALUE st
185185
return lexer;
186186
}
187187

188-
static rbs_parser_t *alloc_parser_from_buffer(VALUE buffer, int start_pos, int end_pos) {
188+
// Build the parser options from the arguments the `_parse_*` entry points
189+
// receive. The optional syntax these enable is not part of the public
190+
// `RBS::Parser` API, so only the private entry points pass them through.
191+
static rbs_parser_options_t parser_options(VALUE enable_forwarding_params) {
192+
return (rbs_parser_options_t) {
193+
.enable_forwarding_params = RB_TEST(enable_forwarding_params),
194+
};
195+
}
196+
197+
static rbs_parser_t *alloc_parser_from_buffer_with_options(VALUE buffer, int start_pos, int end_pos, rbs_parser_options_t options) {
189198
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
190199
StringValue(string);
191200

@@ -194,11 +203,12 @@ static rbs_parser_t *alloc_parser_from_buffer(VALUE buffer, int start_pos, int e
194203
rb_encoding *encoding = rb_enc_get(string);
195204
const char *encoding_name = rb_enc_name(encoding);
196205

197-
rbs_parser_t *parser = rbs_parser_new(
206+
rbs_parser_t *parser = rbs_parser_new_with_options(
198207
rbs_string_from_ruby_string(string),
199208
rbs_encoding_find((const uint8_t *) encoding_name, (const uint8_t *) (encoding_name + strlen(encoding_name))),
200209
start_pos,
201-
end_pos
210+
end_pos,
211+
options
202212
);
203213

204214
if (parser == NULL) {
@@ -208,6 +218,10 @@ static rbs_parser_t *alloc_parser_from_buffer(VALUE buffer, int start_pos, int e
208218
return parser;
209219
}
210220

221+
static rbs_parser_t *alloc_parser_from_buffer(VALUE buffer, int start_pos, int end_pos) {
222+
return alloc_parser_from_buffer_with_options(buffer, start_pos, end_pos, (rbs_parser_options_t) { 0 });
223+
}
224+
211225
static VALUE rbsparser_parse_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof, VALUE void_allowed, VALUE self_allowed, VALUE classish_allowed) {
212226
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
213227
StringValue(string);
@@ -254,12 +268,12 @@ static VALUE parse_method_type_try(VALUE a) {
254268
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) method_type);
255269
}
256270

257-
static VALUE rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof) {
271+
static VALUE rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof, VALUE enable_forwarding_params) {
258272
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
259273
StringValue(string);
260274
rb_encoding *encoding = rb_enc_get(string);
261275

262-
rbs_parser_t *parser = alloc_parser_from_buffer(buffer, FIX2INT(start_pos), FIX2INT(end_pos));
276+
rbs_parser_t *parser = alloc_parser_from_buffer_with_options(buffer, FIX2INT(start_pos), FIX2INT(end_pos), parser_options(enable_forwarding_params));
263277
declare_type_variables(parser, variables, buffer);
264278
struct parse_method_type_arg arg = {
265279
.buffer = buffer,
@@ -293,12 +307,12 @@ static VALUE parse_signature_try(VALUE a) {
293307
return rbs_struct_to_ruby_value(ctx, (rbs_node_t *) signature);
294308
}
295309

296-
static VALUE rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos) {
310+
static VALUE rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE enable_forwarding_params) {
297311
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
298312
StringValue(string);
299313
rb_encoding *encoding = rb_enc_get(string);
300314

301-
rbs_parser_t *parser = alloc_parser_from_buffer(buffer, FIX2INT(start_pos), FIX2INT(end_pos));
315+
rbs_parser_t *parser = alloc_parser_from_buffer_with_options(buffer, FIX2INT(start_pos), FIX2INT(end_pos), parser_options(enable_forwarding_params));
302316
struct parse_signature_arg arg = {
303317
.buffer = buffer,
304318
.encoding = encoding,
@@ -386,12 +400,12 @@ static VALUE parse_method_type_to_bytes_try(VALUE a) {
386400
return serialized_node_to_string(parser, (rbs_node_t *) method_type);
387401
}
388402

389-
static VALUE rbsparser_parse_method_type_to_bytes(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof) {
403+
static VALUE rbsparser_parse_method_type_to_bytes(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE require_eof, VALUE enable_forwarding_params) {
390404
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
391405
StringValue(string);
392406
rb_encoding *encoding = rb_enc_get(string);
393407

394-
rbs_parser_t *parser = alloc_parser_from_buffer(buffer, FIX2INT(start_pos), FIX2INT(end_pos));
408+
rbs_parser_t *parser = alloc_parser_from_buffer_with_options(buffer, FIX2INT(start_pos), FIX2INT(end_pos), parser_options(enable_forwarding_params));
395409
declare_type_variables(parser, variables, buffer);
396410
struct parse_method_type_arg arg = {
397411
.buffer = buffer,
@@ -419,12 +433,12 @@ static VALUE parse_signature_to_bytes_try(VALUE a) {
419433
return serialized_node_to_string(parser, (rbs_node_t *) signature);
420434
}
421435

422-
static VALUE rbsparser_parse_signature_to_bytes(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos) {
436+
static VALUE rbsparser_parse_signature_to_bytes(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE enable_forwarding_params) {
423437
VALUE string = rb_funcall(buffer, rb_intern("content"), 0);
424438
StringValue(string);
425439
rb_encoding *encoding = rb_enc_get(string);
426440

427-
rbs_parser_t *parser = alloc_parser_from_buffer(buffer, FIX2INT(start_pos), FIX2INT(end_pos));
441+
rbs_parser_t *parser = alloc_parser_from_buffer_with_options(buffer, FIX2INT(start_pos), FIX2INT(end_pos), parser_options(enable_forwarding_params));
428442
struct parse_signature_arg arg = {
429443
.buffer = buffer,
430444
.encoding = encoding,
@@ -609,11 +623,11 @@ void rbs__init_parser(void) {
609623
rb_gc_register_mark_object(EMPTY_HASH);
610624

611625
rb_define_singleton_method(RBS_Parser, "_parse_type", rbsparser_parse_type, 8);
612-
rb_define_singleton_method(RBS_Parser, "_parse_method_type", rbsparser_parse_method_type, 5);
613-
rb_define_singleton_method(RBS_Parser, "_parse_signature", rbsparser_parse_signature, 3);
626+
rb_define_singleton_method(RBS_Parser, "_parse_method_type", rbsparser_parse_method_type, 6);
627+
rb_define_singleton_method(RBS_Parser, "_parse_signature", rbsparser_parse_signature, 4);
614628
rb_define_singleton_method(RBS_Parser, "_parse_type_to_bytes", rbsparser_parse_type_to_bytes, 8);
615-
rb_define_singleton_method(RBS_Parser, "_parse_method_type_to_bytes", rbsparser_parse_method_type_to_bytes, 5);
616-
rb_define_singleton_method(RBS_Parser, "_parse_signature_to_bytes", rbsparser_parse_signature_to_bytes, 3);
629+
rb_define_singleton_method(RBS_Parser, "_parse_method_type_to_bytes", rbsparser_parse_method_type_to_bytes, 6);
630+
rb_define_singleton_method(RBS_Parser, "_parse_signature_to_bytes", rbsparser_parse_signature_to_bytes, 4);
617631
rb_define_singleton_method(RBS_Parser, "_parse_type_params", rbsparser_parse_type_params, 4);
618632
rb_define_singleton_method(RBS_Parser, "_parse_inline_leading_annotation", rbsparser_parse_inline_leading_annotation, 4);
619633
rb_define_singleton_method(RBS_Parser, "_parse_inline_trailing_annotation", rbsparser_parse_inline_trailing_annotation, 4);

lib/rbs/parser_aux.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def self.parse_type(source, range: nil, byte_range: 0..., variables: [], require
1414
def self.parse_method_type(source, range: nil, byte_range: 0..., variables: [], require_eof: false)
1515
buf = buffer(source)
1616
byte_range = byte_range(range, buf.content) if range
17-
_parse_method_type(buf, byte_range.begin || 0, byte_range.end || buf.content.bytesize, variables, require_eof)
17+
_parse_method_type(buf, byte_range.begin || 0, byte_range.end || buf.content.bytesize, variables, require_eof, false)
1818
end
1919

2020
def self.parse_signature(source)
@@ -28,7 +28,7 @@ def self.parse_signature(source)
2828
0
2929
end
3030
content = buf.content
31-
dirs, decls = _parse_signature(buf, start_pos, content.bytesize)
31+
dirs, decls = _parse_signature(buf, start_pos, content.bytesize, false)
3232

3333
if resolved
3434
dirs = dirs.dup if dirs.frozen?

lib/rbs/wasm/parser.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ module RBS
1212
# RBS::Parser API on top, exactly as it does for the C extension.
1313
class Parser
1414
class << self
15-
def _parse_signature(buffer, start_pos, end_pos)
15+
def _parse_signature(buffer, start_pos, end_pos, enable_forwarding_params)
1616
validate_position_range(buffer, start_pos, end_pos)
17+
validate_parser_options(enable_forwarding_params)
1718
encoding = buffer.content.encoding.name
1819
status, bytes = WASM::Runtime.instance.parse_signature(buffer.content, encoding, start_pos, end_pos)
1920
raise_parse_failure(buffer, status, bytes, start_pos, end_pos) unless status == WASM::Runtime::OK
@@ -31,9 +32,10 @@ def _parse_type(buffer, start_pos, end_pos, variables, require_eof, void_allowed
3132
deserialize_or_nil(bytes, buffer)
3233
end
3334

34-
def _parse_method_type(buffer, start_pos, end_pos, variables, require_eof)
35+
def _parse_method_type(buffer, start_pos, end_pos, variables, require_eof, enable_forwarding_params)
3536
validate_position_range(buffer, start_pos, end_pos)
3637
validate_variables(variables)
38+
validate_parser_options(enable_forwarding_params)
3739
encoding = buffer.content.encoding.name
3840
status, bytes = WASM::Runtime.instance.parse_method_type(buffer.content, encoding, start_pos, end_pos, variables, require_eof)
3941
raise_parse_failure(buffer, status, bytes, start_pos, end_pos) unless status == WASM::Runtime::OK
@@ -99,6 +101,15 @@ def validate_position_range(buffer, start_pos, end_pos)
99101
end
100102
end
101103

104+
# The WebAssembly entry points (rbs_wasm.c) build their parsers with the
105+
# default options, so the optional syntax the C extension can enable is
106+
# not reachable here. The public RBS::Parser API never enables it.
107+
def validate_parser_options(enable_forwarding_params)
108+
if enable_forwarding_params
109+
raise NotImplementedError, "forwarding parameter syntax is not supported by the WebAssembly parser"
110+
end
111+
end
112+
102113
# Reject anything that is not nil or an Array of Symbols, matching
103114
# declare_type_variables in the C extension (main.c).
104115
def validate_variables(variables)

sig/parser.rbs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,23 @@ module RBS
136136

137137
def self._parse_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool void_allowed, bool self_allowed, bool classish_allowed) -> Types::t?
138138

139-
def self._parse_method_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof) -> MethodType?
139+
# The `enable_forwarding_params` argument enables `(...)` forwarding
140+
# parameters, which are experimental and have no type checking semantics
141+
# yet. It is deliberately not exposed through the public `parse_*` methods,
142+
# so signatures written for the gem can't use the syntax.
143+
def self._parse_method_type: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool enable_forwarding_params) -> MethodType?
140144

141-
def self._parse_signature: (Buffer, Integer start_pos, Integer end_pos) -> [Array[AST::Directives::t], Array[AST::Declarations::t]]
145+
def self._parse_signature: (Buffer, Integer start_pos, Integer end_pos, bool enable_forwarding_params) -> [Array[AST::Directives::t], Array[AST::Declarations::t]]
142146

143147
# Parse and serialize the result to the binary format consumed by
144148
# RBS::WASM::Deserializer (see ext/rbs_extension/main.c and
145149
# docs/wasm_serialization.md). The `_to_bytes` variants exist so the
146150
# round-trip can be exercised on CRuby.
147151
def self._parse_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool void_allowed, bool self_allowed, bool classish_allowed) -> String?
148152

149-
def self._parse_method_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof) -> String?
153+
def self._parse_method_type_to_bytes: (Buffer, Integer start_pos, Integer end_pos, Array[Symbol] variables, bool require_eof, bool enable_forwarding_params) -> String?
150154

151-
def self._parse_signature_to_bytes: (Buffer, Integer start_pos, Integer end_pos) -> String
155+
def self._parse_signature_to_bytes: (Buffer, Integer start_pos, Integer end_pos, bool enable_forwarding_params) -> String
152156

153157
def self._parse_type_params: (Buffer, Integer start_pos, Integer end_pos, bool module_type_params) -> Array[AST::TypeParam]
154158

test/rbs/method_type_parsing_test.rb

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ def parse_signature(string)
2323
RBS::Parser.parse_signature(buffer)
2424
end
2525

26+
# `(...)` forwarding parameters are gated behind a parser option that the
27+
# public API deliberately doesn't expose, so the tests below reach for the
28+
# private entry points to exercise the syntax itself.
29+
def parse_method_type_with_forwarding(string)
30+
buffer = Buffer.new(content: string.encode(Encoding::UTF_8), name: "sample.rbs")
31+
RBS::Parser._parse_method_type(buffer, 0, buffer.content.bytesize, nil, true, true)
32+
end
33+
34+
def parse_signature_with_forwarding(string)
35+
buffer = Buffer.new(content: string.encode(Encoding::UTF_8), name: "sample.rbs")
36+
RBS::Parser._parse_signature(buffer, 0, buffer.content.bytesize, true)
37+
end
38+
2639
def test_method_type
2740
Parser.parse_method_type("()->void").yield_self do |type|
2841
assert_equal "() -> void", type.to_s
@@ -48,10 +61,9 @@ def test_method_param
4861
end
4962
end
5063

51-
def test_forwarding_parameter_syntax_is_not_enabled
52-
# `(...)` forwarding parameters are gated behind a C-level parser option
53-
# (`rbs_parser_options_t`) that the Ruby API doesn't expose, so parsing
54-
# them from Ruby is always an error.
64+
def test_forwarding_parameter_syntax_is_not_enabled_by_default
65+
# The syntax has no type checking semantics yet, so the public API never
66+
# enables it. Signatures shipped in the wild can't use it.
5567
error = assert_raise(RBS::ParsingError) do
5668
parse_method_type("(...) -> void")
5769
end
@@ -60,19 +72,46 @@ def test_forwarding_parameter_syntax_is_not_enabled
6072
assert_raise(RBS::ParsingError) do
6173
parse_method_type("(String message, ...) -> void")
6274
end
63-
end
6475

65-
def test_forwarding_parameter_syntax_is_not_enabled_in_signature
6676
assert_raise(RBS::ParsingError) do
6777
parse_signature(<<~RBS)
6878
class Foo
6979
def foo: (...) -> void
70-
| ...
7180
end
7281
RBS
7382
end
7483
end
7584

85+
def test_forwarding_parameter
86+
parse_method_type_with_forwarding("(...) -> void").tap do |type|
87+
assert_equal "(...) -> void", type.to_s
88+
assert_instance_of Types::Function::ForwardingParam, type.type.forwarding
89+
assert_equal "...", type.type.forwarding.location.source
90+
assert_empty type.type.required_positionals
91+
assert_nil type.block
92+
end
93+
94+
parse_method_type_with_forwarding("(String message, ...) -> void").tap do |type|
95+
assert_equal "(String message, ...) -> void", type.to_s
96+
assert_equal 1, type.type.required_positionals.size
97+
assert_predicate type.type, :forwarding?
98+
assert_instance_of Types::Function::ForwardingParam, type.type.forwarding
99+
end
100+
end
101+
102+
def test_forwarding_parameter_with_overload_continuation
103+
_, declarations = parse_signature_with_forwarding(<<~RBS)
104+
class Foo
105+
def foo: (...) -> void
106+
| ...
107+
end
108+
RBS
109+
110+
method = declarations.fetch(0).members.fetch(0)
111+
assert_predicate method, :overloading?
112+
assert_predicate method.overloads.fetch(0).method_type.type, :forwarding?
113+
end
114+
76115
def test_forwarding_parameter_rejects_nonleading_parameters
77116
[
78117
"(?String value, ...) -> void",
@@ -82,7 +121,7 @@ def test_forwarding_parameter_rejects_nonleading_parameters
82121
"(**String values, ...) -> void",
83122
].each do |source|
84123
assert_raise(RBS::ParsingError) do
85-
parse_method_type(source)
124+
parse_method_type_with_forwarding(source)
86125
end
87126
end
88127
end
@@ -94,7 +133,7 @@ def test_forwarding_parameter_must_be_last
94133
"(...,) -> void",
95134
].each do |source|
96135
assert_raise(RBS::ParsingError) do
97-
parse_method_type(source)
136+
parse_method_type_with_forwarding(source)
98137
end
99138
end
100139
end
@@ -105,25 +144,29 @@ def test_forwarding_parameter_cannot_have_explicit_block
105144
"(...) ?{ () -> void } -> void",
106145
].each do |source|
107146
assert_raise(RBS::ParsingError) do
108-
parse_method_type(source)
147+
parse_method_type_with_forwarding(source)
109148
end
110149
end
111150
end
112151

113152
def test_forwarding_parameter_is_not_allowed_in_block_types
114-
assert_raise(RBS::ParsingError) do
115-
parse_method_type("() { (...) -> void } -> void")
153+
error = assert_raise(RBS::ParsingError) do
154+
parse_method_type_with_forwarding("() { (...) -> void } -> void")
116155
end
156+
assert_include error.message, "forwarding parameter is not allowed in this context"
117157
end
118158

119159
def test_forwarding_parameter_is_not_allowed_in_proc_types
160+
# Proc types are parsed by `_parse_type`, which has no way to enable the
161+
# syntax, but the context restriction is checked before the option anyway.
120162
[
121163
"^(...) -> void",
122164
"^(String, ...) -> void",
123165
].each do |source|
124-
assert_raise(RBS::ParsingError) do
166+
error = assert_raise(RBS::ParsingError) do
125167
parse_type(source)
126168
end
169+
assert_include error.message, "forwarding parameter is not allowed in this context"
127170
end
128171
end
129172

test/rbs/parser_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ class Foo[T < Integer] < Bar # Comment
10331033
def test_invalid_position_range_raises
10341034
# Regression: start_pos > end_pos used to cause an infinite loop in the lexer.
10351035
assert_raises(ArgumentError) do
1036-
RBS::Parser._parse_signature(buffer(""), 1, 0)
1036+
RBS::Parser._parse_signature(buffer(""), 1, 0, false)
10371037
end
10381038
end
10391039

@@ -1051,7 +1051,7 @@ def test_invalid_utf8_byte_in_comment_does_not_hang
10511051
# Regression: invalid UTF-8 byte in a comment used to loop forever in the lexer.
10521052
source = "# \xC2".dup.force_encoding(Encoding::UTF_8)
10531053
assert_raises(RBS::ParsingError) do
1054-
RBS::Parser._parse_signature(buffer(source), 0, source.bytesize)
1054+
RBS::Parser._parse_signature(buffer(source), 0, source.bytesize, false)
10551055
end
10561056
end
10571057

@@ -1061,7 +1061,7 @@ def test_invalid_utf8_byte_at_top_level_raises
10611061
# Regression: invalid UTF-8 byte at top level used to trip RBS_ASSERT in the C extension.
10621062
source = "\xFF".dup.force_encoding(Encoding::UTF_8)
10631063
assert_raises(RBS::ParsingError) do
1064-
RBS::Parser._parse_signature(buffer(source), 0, source.bytesize)
1064+
RBS::Parser._parse_signature(buffer(source), 0, source.bytesize, false)
10651065
end
10661066
end
10671067

@@ -1183,7 +1183,7 @@ def test_utf8_replacement_character_in_comment_parses
11831183
# ("\xEF\xBF\xBD") that decodes to the multibyte dummy code point, not the
11841184
# sentinel that marks an invalid byte. A comment containing it must parse fine.
11851185
source = "# \u{FFFD}\ntype x = untyped\n".dup.force_encoding(Encoding::UTF_8)
1186-
_, decls = RBS::Parser._parse_signature(buffer(source), 0, source.bytesize)
1186+
_, decls = RBS::Parser._parse_signature(buffer(source), 0, source.bytesize, false)
11871187
assert_equal 1, decls.size
11881188
assert_instance_of RBS::AST::Declarations::TypeAlias, decls[0]
11891189
end

test/rbs/schema_test.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,11 @@ def test_method_type_schema
121121
parse_method_type("[G] (A a, ?B, *C, d: D, ?e: E e, **f) ?{ (G) -> void } -> String").to_json
122122
)
123123

124-
# Forwarding parameters can't be parsed from Ruby, so build the node directly
124+
# Forwarding parameters are only parsed when explicitly enabled
125+
source = "(String message, ...) -> void"
125126
JSONValidator.method_type.validate!(
126-
RBS::MethodType.new(
127-
type_params: [],
128-
type: RBS::Types::Function.empty(RBS::Types::Bases::Void.new(location: nil)).update(
129-
forwarding: RBS::Types::Function::ForwardingParam.new(location: nil)
130-
),
131-
block: nil,
132-
location: nil
127+
RBS::Parser._parse_method_type(
128+
RBS::Buffer.new(content: source, name: "test.rbs"), 0, source.bytesize, nil, true, true
133129
).to_json
134130
)
135131
end

0 commit comments

Comments
 (0)