Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a failing JIT spec for zsuper keyword arguments support
Browse files Browse the repository at this point in the history
ahmadsherif committed Feb 12, 2016
1 parent 1f74149 commit 205a5c5
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/jit/method_spec.rb
Original file line number Diff line number Diff line change
@@ -155,5 +155,29 @@ def m(a=1, **kw) [a, kw] end
end
end
end

context "to m(a:, b: 'b', **) super end" do
before :each do
parent = Class.new do
def m(**args) args end
end

child = Class.new(parent) do
def m(a:, b: 'b', **) super end
end

@o = child.new

jit(@o, :m) { @o.m(a: "a", c: "c") }
end

it "compiles" do
@o.method(:m).executable.jitted?.should be_true
end

it "returns all keyword arguments passed including default ones" do
@o.m(a: "a", c: "c").should == {a: "a", b: "b", c: "c"}
end
end
end
end
1 change: 1 addition & 0 deletions spec/tags/jit/method_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
fails:JIT compiling a method call to m(a: 0) compiles
fails:JIT compiling a method call to m(a=1, **kw) compiles
fails:JIT compiling a method call to m(a:, b: 'b', **) super end compiles

0 comments on commit 205a5c5

Please sign in to comment.