ruby-changes:56290
From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Jun 2019 19:23:49 +0900 (JST)
Subject: [ruby-changes:56290] Nobuyoshi Nakada: 75129c62eb (trunk): Suppress "statement not reached" warning
https://git.ruby-lang.org/ruby.git/commit/?id=75129c62eb From 75129c62ebfcd67f08262a6f755e5c899e8ebaee Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 30 Jun 2019 09:56:30 +0900 Subject: Suppress "statement not reached" warning diff --git a/test/-ext-/iseq_load/test_iseq_load.rb b/test/-ext-/iseq_load/test_iseq_load.rb index cf60fd9..ffa6541 100644 --- a/test/-ext-/iseq_load/test_iseq_load.rb +++ b/test/-ext-/iseq_load/test_iseq_load.rb @@ -92,7 +92,9 @@ class TestIseqLoad < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/-ext-/iseq_load/test_iseq_load.rb#L92 begin; 3.times { 3.times { next; @next_broke = true } } end; - a = ISeq.compile(src, __FILE__, __FILE__, line).to_a + a = EnvUtil.suppress_warning { + ISeq.compile(src, __FILE__, __FILE__, line) + }.to_a iseq = ISeq.iseq_load(a) iseq.eval assert_equal false, @next_broke diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb index 1a7d628..a39260a 100644 --- a/test/ruby/test_optimization.rb +++ b/test/ruby/test_optimization.rb @@ -347,7 +347,7 @@ class TestRubyOptimization < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L347 def test_tailcall_inhibited_by_rescue bug12082 = '[ruby-core:73871] [Bug #12082]' - tailcall("#{<<-"begin;"}\n#{<<~"end;"}") + EnvUtil.suppress_warning {tailcall("#{<<-"begin;"}\n#{<<~"end;"}")} begin; def to_be_rescued return do_raise -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/