Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 78228a59765f
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79c8359d5523
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Jul 19, 2016

  1. Squashed 'spec/ruby/' changes from 9601c82..884bfb7

    884bfb7 Add a edge-case spec for assignment operator + safe navigator
    
    git-subtree-dir: spec/ruby
    git-subtree-split: 884bfb796c39a649f5117a0555be4a6854959468
    eregon committed Jul 19, 2016
    Copy the full SHA
    575e327 View commit details
  2. Copy the full SHA
    79c8359 View commit details
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/ruby/language/safe_navigator_spec.rb
16 changes: 16 additions & 0 deletions spec/ruby/language/safe_navigator_spec.rb
Original file line number Diff line number Diff line change
@@ -81,5 +81,21 @@ def initialize
obj = nil
eval("obj&.m += 3").should == nil
end

it "does not call the operator method lazily with an assignment operator" do
klass = Class.new do
attr_writer :foo
def foo
nil
end
end
obj = klass.new

lambda {
eval("obj&.foo += 3")
}.should raise_error(NoMethodError) { |e|
e.name.should == :+
}
end
end
end