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

Support cases where Module#constants has been redefined #1591

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Nov 1, 2023

rbs 3.3.0.pre.1

When analyzing the gem rouge with prototype runtime, an error occurs.
The cause is that the .constants method is overridden in rouge.

I fixed the issue by using the method of calling the Module#constants UnboundMethod.

repro

$ bundle exec rbs prototype runtime -r rouge Rouge::Lexers::Actionscript

before

/ruby/3.2.0/gems/rouge-4.1.1/lib/rouge/lexers/actionscript.rb:96:in `constants': wrong number of arguments (given 1, expected 0) (ArgumentError)

after

module Rouge
  module Lexers
    class Actionscript < ::Rouge::RegexLexer
      def self.builtins: () -> untyped

      def self.constants: () -> untyped

      def self.declarations: () -> untyped

      def self.keywords: () -> untyped

      def self.reserved: () -> untyped
    end
  end
end

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro added this pull request to the merge queue Nov 1, 2023
@soutaro soutaro added this to the RBS 3.3 milestone Nov 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 1, 2023
@soutaro soutaro enabled auto-merge November 1, 2023 08:46
@soutaro soutaro added this pull request to the merge queue Nov 1, 2023
Merged via the queue into ruby:master with commit 3e5c12c Nov 1, 2023
23 checks passed
@ksss ksss deleted the runtime-constants branch November 1, 2023 08:54
@soutaro soutaro added the Released PRs already included in the released version label Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants