aboutsummaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-08-17 16:46:56 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2023-08-17 17:17:31 -0400
commit5d48825d55bedd1d0d9f975efa01cfc443b2451c (patch)
tree2e8ac9f963841cbd4f2dbcb37e7506c422437b28 /bootstraptest
parent518d5ab5c8be9372b5409984773eeadc1980cd10 (diff)
downloadruby-5d48825d55bedd1d0d9f975efa01cfc443b2451c.tar.gz
YJIT: Fix String#<< return type
We previously falsely asserted that String#<< always returns a ::String instance. Issue was discovered on CI with `--yjit-verify-ctx`. https://github.com/ruby/ruby/actions/runs/5893760435/job/15986002531
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_yjit.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 196fa454ff..249c4c19c7 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -1,3 +1,12 @@
+# regression test for return type of String#<<
+assert_equal 'Sub', %q{
+ def call(sub) = (sub << sub).itself
+
+ class Sub < String; end
+
+ call(Sub.new('o')).class
+}
+
# test splat filling required and feeding rest
assert_equal '[0, 1, 2, [3, 4]]', %q{
public def lead_rest(a, b, *rest)