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

Warnings 3.2.x #1583

Draft
wants to merge 2 commits into
base: aaa-3.2.x
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions lib/rbs/prototype/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,15 @@ def const_name(const)
return nil unless name

begin
deprecated, Warning[:deprecated] = Warning[:deprecated], false
Object.const_get(name)
rescue NameError
# Should generate const name if anonymous or internal module (e.g. NameError::message)
nil
else
name
ensure
Warning[:deprecated] = deprecated
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/rbs/cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,8 @@ def test_collection_install_gemspec

stdout, _ = run_rbs("collection", "install", bundler: true)

assert_match /^Installing ast:(\d(\.\d)*)/, stdout
refute_match /^Using hola:(\d(\.\d)*)/, stdout
assert_match(/^Installing ast:(\d(\.\d)*)/, stdout)
refute_match(/^Using hola:(\d(\.\d)*)/, stdout)

assert dir.join('rbs_collection.lock.yaml').exist?
assert dir.join('gem_rbs_collection/ast').exist?
Expand Down
6 changes: 0 additions & 6 deletions test/rbs/definition_builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2609,8 +2609,6 @@ class Hoge < Baz::Bar
EOF

manager.build do |env|
root = nil

builder = DefinitionBuilder.new(env: env)

builder.build_instance(type_name("::Hoge"))
Expand All @@ -2634,8 +2632,6 @@ class Baz
EOF

manager.build do |env|
root = nil

builder = DefinitionBuilder.new(env: env)

builder.build_instance(type_name("::Baz"))
Expand All @@ -2654,8 +2650,6 @@ module Bar : Foo
EOF

manager.build do |env|
root = nil

builder = DefinitionBuilder.new(env: env)

builder.build_instance(type_name("::Bar"))
Expand Down
2 changes: 0 additions & 2 deletions test/validator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,6 @@ class Baz = Numeric
EOF

manager.build do |env|
root = nil

resolver = RBS::Resolver::TypeNameResolver.new(env)
validator = RBS::Validator.new(env: env, resolver: resolver)

Expand Down
Loading