-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add Ruby 3.0 support #1178
Add Ruby 3.0 support #1178
Conversation
723c306
to
1ecdf33
Compare
a4fad01
to
9b3ebca
Compare
bundle exec mutant run \ | ||
--zombie \ | ||
--ignore-subject Mutant::CLI#add_debug_options \ | ||
--ignore-subject Mutant::Expression::Namespace::Recursive#initialize \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A mutation for 3.0 specific code here. We need version specific configuration to exclude the subject (or mutation) on specific versions.
@@ -119,7 +119,7 @@ jobs: | |||
strategy: | |||
fail-fast: false | |||
matrix: | |||
ruby: [ruby-2.7] | |||
ruby: [ruby-2.7, ruby-3.0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you intentionally running rubocop on two versions of ruby?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the moment yes, will soon remove 2.7.
@@ -17,7 +17,7 @@ class Recursive < self | |||
def initialize(*) | |||
super | |||
|
|||
@syntax = "#{scope_name}*" | |||
@syntax = "#{scope_name}*".freeze # rubocop:disable Style/RedundantFreeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also curious if you know something I don't about this--I thought this was automatically frozen even with interpolation?
# frozen_string_literal: true
class Foo
def initialize
@test = "#{rand}-test"
pp @test.frozen?
end
end
Foo.new # outputs `true`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://twitter.com/_m_b_j_/status/1342635659547340800
TLDR: MRI decided that, as each dstr gets allocated always freezing makes no sense.
I disagree as freezing is also a correctness mechanism, not just a memory optimization.
Instead: They should have patched MRI that as +"some-#{dstr}"
would create a mutable DSTR, without frozen intermediary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...oh. I don't like that at all. :(
No description provided.