diff options
| author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-12-12 11:08:40 -0500 |
|---|---|---|
| committer | Jemma Issroff <jemmaissroff@gmail.com> | 2023-12-12 13:45:21 -0500 |
| commit | b9dfe04a73b9b4b9a3d3e96a3418a8d105e5c63a (patch) | |
| tree | fe951447c5aeb6a14837d82afc0a87d01cfc701e /test/ruby | |
| parent | 68753e44083f7d4d171f66aa092b35ccb41a66f6 (diff) | |
[PRISM] Implementing forwarding of args for ForwardingSuperNode
ForwardingSuperNodes need to actually forward any applicable
arguments. This commit implements that logic, by using the data
stored on the local iseq about the parameters to forward the
appropriate arguments.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 2bc1821936..05db94227e 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -1543,6 +1543,22 @@ module Prism def test_ForwardingSuperNode assert_prism_eval("class Forwarding; def to_s; super; end; end") assert_prism_eval("class Forwarding; def eval(code); super { code }; end; end") + assert_prism_eval(<<-CODE) + class A + def initialize(a, b) + end + end + + class B < A + attr_reader :res + def initialize(a, b, *) + super + @res = [a, b] + end + end + + B.new(1, 2).res + CODE end def test_KeywordHashNode |
