Skip to content

Commit 8ca1845

Browse files
committed
Call Any#todo! from constructor
Signed-off-by: Alexandre Terrasa <[email protected]>
1 parent d959812 commit 8ca1845

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/rbs/types.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def with_nonreturn_void?
107107
class Bool < Base; end
108108
class Void < Base; end
109109
class Any < Base
110+
def initialize(location:, todo: false)
111+
super(location: location)
112+
todo! if todo
113+
end
114+
110115
def to_s(level=0)
111116
@string || "untyped"
112117
end

src/ruby_objs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,9 @@ VALUE rbs_alias(VALUE name, VALUE args, VALUE location) {
501501
);
502502
}
503503

504-
VALUE rbs_bases_any(VALUE location) {
504+
VALUE rbs_bases_any(VALUE todo, VALUE location) {
505505
VALUE _init_kwargs = rb_hash_new();
506+
rb_hash_aset(_init_kwargs, ID2SYM(rb_intern("todo")), todo);
506507
rb_hash_aset(_init_kwargs, ID2SYM(rb_intern("location")), location);
507508

508509
return CLASS_NEW_INSTANCE(

0 commit comments

Comments
 (0)