```
.../ruby/test/ruby/test_keyword.rb:3509: warning: assigned but unused variable - bug8993
.../ruby/test/ruby/test_object.rb:83: warning: assigned but unused variable - f
.../ruby/test/ruby/test_object.rb:95: warning: method redefined; discarding old initialize_clone
.../ruby/test/ruby/test_object.rb:84: warning: previous definition of initialize_clone was here
```
This commit is contained in:
Yusuke Endoh 2020-01-07 01:33:30 +09:00
Родитель 7392083c2f
Коммит e92bebb0c5
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -3506,7 +3506,6 @@ class TestKeywordArguments < Test::Unit::TestCase
end end
def test_precedence_of_keyword_arguments_with_post_argument def test_precedence_of_keyword_arguments_with_post_argument
bug8993 = '[ruby-core:57706] [Bug #8993]'
a = Class.new do a = Class.new do
def foo(a, b, c=1, *d, e, f:2, **g) def foo(a, b, c=1, *d, e, f:2, **g)
[a, b, c, d, e, f, g] [a, b, c, d, e, f, g]

Просмотреть файл

@ -80,7 +80,6 @@ class TestObject < Test::Unit::TestCase
attr_reader :f attr_reader :f
end end
o = c.new o = c.new
f = true
def o.initialize_clone(_, freeze: true) def o.initialize_clone(_, freeze: true)
@f = freeze @f = freeze
super super
@ -92,6 +91,9 @@ class TestObject < Test::Unit::TestCase
assert_kind_of c, clone assert_kind_of c, clone
assert_equal false, clone.f assert_equal false, clone.f
class << o
remove_method(:initialize_clone)
end
def o.initialize_clone(_) def o.initialize_clone(_)
super super
end end