summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2024-04-17 19:46:48 +0900
committerKoichi Sasada <[email protected]>2024-04-17 20:26:49 +0900
commite9d7478dedbd2b57530bc17efe8a9db9b8b2f280 (patch)
treec41d4f58e25d3ca4532a60247c6019f6df767300 /vm.c
parent6ade36c06b7cef948099b8f5f483763498705d12 (diff)
relax unused block warning for duck typing
if a method `foo` uses a block, other (unrelated) method `foo` can receives a block. So try to relax the unused block warning condition. ```ruby class C0 def f = yield end class C1 < C0 def f = nil end [C0, C1].f{ block } # do not warn ```
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 3fb57e2eb6..cf2bed84e4 100644
--- a/vm.c
+++ b/vm.c
@@ -4254,6 +4254,7 @@ Init_BareVM(void)
vm->negative_cme_table = rb_id_table_create(16);
vm->overloaded_cme_table = st_init_numtable();
vm->constant_cache = rb_id_table_create(0);
+ vm->unused_block_warning_table = st_init_numtable();
// setup main thread
th->nt = ZALLOC(struct rb_native_thread);