diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-28 16:12:19 -0500 |
|---|---|---|
| committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-28 17:01:34 -0500 |
| commit | a9c07cbd2128ae8fcb11862265d5fa24feaf3d4f (patch) | |
| tree | e7fbf35d338316cd66f22659eb7b700d7eff62e9 /test/ruby | |
| parent | 04cbcd37b1c18c4db4b9df8d80abb4efec11755c (diff) | |
[PRISM] Don't calculate params size based on locals
Prior to this commit, we were conflating the size of the locals
list with the number of parameters. This commit distinguishes
the two, and fixes a related bug which would occur if we set a local
that was not a parameter
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index b7dc6a6e0f..8a078c01cc 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -756,6 +756,7 @@ module Prism assert_prism_eval("def self.prism_test_def_node() 1 end; prism_test_def_node()") assert_prism_eval("def self.prism_test_def_node(a,b) [a, b] end; prism_test_def_node(1,2)") assert_prism_eval("def self.prism_test_def_node(a,x=7,y=1) x end; prism_test_def_node(7,1)") + assert_prism_eval("def self.prism_test_def_node(a = 1); x = 2; end; prism_test_def_node") # rest argument assert_prism_eval("def self.prism_test_def_node(*a) a end; prism_test_def_node().inspect") |
