Fix warn polyfill when no uplevel is provided#3647
Merged
Conversation
Earlopain
marked this pull request as ready for review
September 14, 2025 10:03
Collaborator
Author
|
JRuby can't handle this is seems... |
Earlopain
force-pushed
the
fix-warn-polyfill
branch
from
September 14, 2025 10:16
42a8d17 to
f3bbeb8
Compare
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this pull request
Sep 14, 2025
Prism 1.5.0 polyfills `warn` in an incompatible way: ruby/prism#3647
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this pull request
Sep 14, 2025
Prism 1.5.0 polyfills `warn` in an incompatible way: ruby/prism#3647
8 tasks
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this pull request
Sep 14, 2025
Prism 1.5.0 polyfills `warn` in an incompatible way: ruby/prism#3647
Earlopain
added a commit
to Earlopain/rubocop
that referenced
this pull request
Sep 14, 2025
Prism 1.5.0 polyfills `warn` in an incompatible way: ruby/prism#3647
kddnewton
requested changes
Sep 14, 2025
kddnewton
left a comment
Collaborator
There was a problem hiding this comment.
Can you either keep the Integer check or just make it .nil? Instead of the case? Either way is fine with me
An unspecified uplevel is not the same as an uplevel of 1:
```
$ irb
irb(main):001> warn("foo")
foo
=> nil
irb(main):002> warn("foo", uplevel: 1)
/home/user/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/irb-1.14.0/lib/irb/workspace.rb:121: warning: foo
=> nil
```
Earlopain
force-pushed
the
fix-warn-polyfill
branch
from
September 15, 2025 06:39
f3bbeb8 to
dcedd14
Compare
kddnewton
approved these changes
Sep 15, 2025
bquorning
added a commit
to rubocop/rubocop-rspec
that referenced
this pull request
Sep 15, 2025
Prism 1.5.0 polyfills `warn` in an incompatible way: ruby/prism#3647 Based on Earlopain's commit on RuboCop.
tompng
added a commit
to ruby/rdoc
that referenced
this pull request
Sep 16, 2025
Fix JRuby ci failure
```
Failure: test_check_files_warn(RDocOptionsTest)
/home/runner/work/rdoc/rdoc/test/rdoc/rdoc_options_test.rb:50:in 'test_check_files_warn'
49: assert_empty out
=> 50: assert_equal "file 'nonexistent' not found\n", err
51: assert_empty @options.files
52: end
<"file 'nonexistent' not found\n"> expected but was
<"/home/runner/work/rdoc/rdoc/lib/rdoc/options.rb:1370: warning: file 'nonexistent' not found\n">
```
Related to ruby/prism#3647
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An unspecified uplevel is not the same as an uplevel of 1:
cc @koic