diff options
author | Koichi Sasada <[email protected]> | 2024-04-17 19:46:48 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2024-04-17 20:26:49 +0900 |
commit | e9d7478dedbd2b57530bc17efe8a9db9b8b2f280 (patch) | |
tree | c41d4f58e25d3ca4532a60247c6019f6df767300 /vm.c | |
parent | 6ade36c06b7cef948099b8f5f483763498705d12 (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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |