Skip to content
This repository

Remove a warning "shadowing outer local variable - type" #74

Merged
merged 1 commit into from over 1 year ago

2 participants

Kenichi Kamiya Delano Mandelbaum
Kenichi Kamiya

Note

An reproducing example is net-sftp's test.
Specify $VERBOSE = true at top of test/test_all.rb

Delano Mandelbaum delano merged commit 9abfc1c into from January 11, 2013
Delano Mandelbaum delano closed this January 11, 2013
Delano Mandelbaum
Collaborator

Thank you.

Kenichi Kamiya kachick deleted the branch January 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 11, 2013
Kenichi Kamiya Remove a warning "shadowing outer local variable - type" b39e38e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  lib/net/ssh/test/local_packet.rb
8  lib/net/ssh/test/local_packet.rb
@@ -33,17 +33,17 @@ def process(packet)
33 33
       type = packet.read_byte
34 34
       raise "expected #{@type}, but got #{type}" if @type != type
35 35
 
36  
-      @data.zip(types).each do |expected, type|
37  
-        type ||= case expected
  36
+      @data.zip(types).each do |expected, _type|
  37
+        _type ||= case expected
38 38
           when nil then break
39 39
           when Numeric then :long
40 40
           when String then :string
41 41
           when TrueClass, FalseClass then :bool
42 42
           end
43 43
 
44  
-        actual = packet.send("read_#{type}")
  44
+        actual = packet.send("read_#{_type}")
45 45
         next if expected.nil?
46  
-        raise "expected #{type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual
  46
+        raise "expected #{_type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual
47 47
       end
48 48
     end
49 49
   end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.