Skip to content

Commit

Permalink
Merge pull request #1314 from nobu/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings
  • Loading branch information
soutaro committed Apr 25, 2023
2 parents aa06307 + 884b3a6 commit a6055fc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion test/rbs/node_usage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def parse(string)
end

def test_conditional
usage = NodeUsage.new(parse(<<~RB))
NodeUsage.new(parse(<<~RB))
if block
yield
end
Expand Down
44 changes: 22 additions & 22 deletions test/rbs/rb_prototype_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,36 +234,36 @@ def when_last_is_nil: () -> nil
end

def test_defs_return_type_with_block_optional
parser = RB.new
parser = RB.new

rb = <<~'EOR'
class Hello
def with_optional_block1
# `block_given?` call makes the block optional
if block_given?
yield 1
end
rb = <<~'EOR'
class Hello
def with_optional_block1
# `block_given?` call makes the block optional
if block_given?
yield 1
end
end
def with_optional_block2(&block)
# testing block var makes the block optional
if block
yield 1
end
def with_optional_block2(&block)
# testing block var makes the block optional
if block
yield 1
end
end
EOR
end
EOR

parser.parse(rb)
parser.parse(rb)

assert_write parser.decls, <<~EOF
class Hello
def with_optional_block1: () ?{ (untyped) -> untyped } -> (untyped | nil)
assert_write parser.decls, <<~EOF
class Hello
def with_optional_block1: () ?{ (untyped) -> untyped } -> (untyped | nil)
def with_optional_block2: () ?{ (untyped) -> untyped } -> (untyped | nil)
end
EOF
end
def with_optional_block2: () ?{ (untyped) -> untyped } -> (untyped | nil)
end
EOF
end

def test_defs_return_type_with_if
parser = RB.new
Expand Down

0 comments on commit a6055fc

Please sign in to comment.