Disallow use of attrset symbols as Struct members

Fixes [Bug #11326]
This commit is contained in:
Jeremy Evans 2019-07-05 10:01:06 -07:00
parent 01b723ba6d
commit e51dca2596
2 changed files with 7 additions and 0 deletions

View file

@ -60,6 +60,10 @@ module TestStruct
assert_equal(1, o.a)
end
def test_attrset_id
assert_raise(ArgumentError) { Struct.new(:x=) }
end
def test_members
klass = @Struct.new(:a)
o = klass.new(1)