Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #1314

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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