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 class name resolution of prototype runtime #1032

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Jun 15, 2022

In $ rbs prototype runtime, there was an unintended output in the case of class.


t.rb

module Foo
  class Bar
    class Baz
    end
  end
end

before

$ bundle exec rbs prototype runtime --require-relative t.rb 'Foo::*'
module Foo
  class Bar
  end

  module Bar
    class Baz
    end
  end
end
$ bundle exec rbs -r pathname -r singleton -r tsort prototype runtime -R lib/rbs 'RBS::*' > before.rbs

$ bundle exec rbs -r pathname -r singleton -r tsort -I before.rbs validate --silent
bundler: failed to load command: rbs (/Users/ksss/.rbenv/versions/3.1.1/lib/ruby/gems/3.1.0/bin/rbs)
/Users/ksss/src/github.com/ksss/rbs/lib/rbs/environment.rb:190:in `insert_decl': before:582:2...610:5: Duplicated declaration: ::RBS::AncestorGraph (RBS::DuplicatedDeclarationError)

after

$ bundle exec rbs prototype runtime --require-relative t.rb 'Foo::*'
module Foo
  class Bar
    class Baz
    end
  end
end
$ bundle exec rbs -r pathname -r singleton -r tsort prototype runtime -R lib/rbs 'RBS::*' > after.rbs

$ bundle exec rbs -r pathname -r singleton -r tsort -I after.rbs validate --silent
# no error

@ksss ksss changed the title Fix class name resolution Fix class name resolution of prototype runtime Jun 15, 2022
Copy link
Member

@pocke pocke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pocke pocke merged commit 76eac1a into ruby:master Jun 16, 2022
@ksss ksss deleted the runtime-class branch June 16, 2022 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants