diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2022-10-03 11:14:32 -0400 |
---|---|---|
committer | Aaron Patterson <tenderlove@ruby-lang.org> | 2022-10-11 08:40:56 -0700 |
commit | ad63b668e22e21c352b852f3119ae98a7acf99f1 (patch) | |
tree | cdaea65a9cae753a25f521c06d9d6a205085335f /bootstraptest | |
parent | 5ffbb2be187681a37f2722ce1d7db4ec5c128464 (diff) |
Revert "Revert "This commit implements the Object Shapes technique in CRuby.""
This reverts commit 9a6803c90b817f70389cae10d60b50ad752da48f.
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_attr.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstraptest/test_attr.rb b/bootstraptest/test_attr.rb index 721a847145..3cb9d3eb39 100644 --- a/bootstraptest/test_attr.rb +++ b/bootstraptest/test_attr.rb @@ -34,3 +34,19 @@ assert_equal %{ok}, %{ print "ok" end }, '[ruby-core:15120]' + +assert_equal %{ok}, %{ + class Big + attr_reader :foo + def initialize + @foo = "ok" + end + end + + obj = Big.new + 100.times do |i| + obj.instance_variable_set(:"@ivar_\#{i}", i) + end + + Big.new.foo +} |