[#99115] [Ruby master Bug#17023] How to prevent String memory to be relocated in ruby-ffi — larskanis@...
Issue #17023 has been reported by larskanis (Lars Kanis).
22 messages
2020/07/10
[#99375] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings — merch-redmine@...
Issue #17055 has been reported by jeremyevans0 (Jeremy Evans).
29 messages
2020/07/28
[#101207] [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— merch-redmine@...
2020/12/02
Issue #17055 has been updated by jeremyevans0 (Jeremy Evans).
[#101231] Re: [Ruby master Feature#17055] Allow suppressing uninitialized instance variable and method redefined verbose mode warnings
— Austin Ziegler <halostatue@...>
2020/12/03
What does this mean?
[ruby-core:99415] [Ruby master Bug#17096] attr_accessor doesnt work
From:
nobu@...
Date:
2020-07-31 08:05:28 UTC
List:
ruby-core #99415
Issue #17096 has been updated by nobu (Nobuyoshi Nakada).
Status changed from Open to Rejected
`type` before and after `type =` are different things in Ruby.
----------------------------------------
Bug #17096: attr_accessor doesnt work
https://bugs.ruby-lang.org/issues/17096#change-86866
* Author: mpavel (pavel m)
* Status: Rejected
* Priority: Normal
* ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin17]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
its copy of incorrectly closed https://bugs.ruby-lang.org/issues/17093
```
require 'rubygems'
class A
def initialize(type:)
@type = type
end
def b
p type
p type.nil?
type = 'default' if type.nil?
type
end
private
attr_accessor :type
end
RSpec.describe A do
let(:type) { 'whoaaa' }
it 'return default' do
expect(A.new(type: type).b).to eq('default')
end
it 'instance variable is "whoaaa"' do
expect(A.new(type: type).instance_variable_get(:@type)).to eq(type)
end
end
all tests green
output
A
"whoaaa"
false
return default
instance variable is "whoaaa"
```
have a look on method b, "p type.nil?" prints false, but next line type = 'default' will run
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>