3 This document is a list of user-visible feature changes
4 since the **3.3.0** release, except for bug fixes.
6 Note that each entry is kept to a minimum, see links for details.
10 * String literals in files without a `frozen_string_literal` comment now emit a deprecation warning
11 when they are mutated.
12 These warnings can be enabled with `-W:deprecated` or by setting `Warning[:deprecated] = true`.
13 To disable this change, you can run Ruby with the `--disable-frozen-string-literal`
14 command line argument. [[Feature #20205]]
16 * `it` is added to reference a block parameter. [[Feature #18980]]
18 * Keyword splatting `nil` when calling methods is now supported.
19 `**nil` is treated similarly to `**{}`, passing no keywords,
20 and not calling any conversion methods. [[Bug #20064]]
22 * Block passing is no longer allowed in index assignment
23 (e.g. `a[0, &b] = 1`). [[Bug #19918]]
25 * Keyword arguments are no longer allowed in index assignment
26 (e.g. `a[0, kw: 1] = 2`). [[Bug #20218]]
28 ## Core classes updates
30 Note: We're only listing outstanding class updates.
34 * Exception#set_backtrace now accepts arrays of `Thread::Backtrace::Location`.
35 `Kernel#raise`, `Thread#raise` and `Fiber#raise` also accept this new format. [[Feature #13557]]
39 * Range#size now raises TypeError if the range is not iterable. [[Misc #18984]]
45 * The keyword argument `anonymous: true` is implemented for `Tempfile.create`.
46 `Tempfile.create(anonymous: true)` removes the created temporary file immediately.
47 So applications don't need to remove the file.
50 The following default gems are updated.
68 The following bundled gems are updated.
82 The following bundled gems are promoted from default gems.
90 * resolv-replace 0.1.1
97 See GitHub releases like [GitHub Releases of Logger](https://github.com/ruby/logger/releases) or changelog for details of the default gems or bundled gems.
99 ## Supported platforms
101 ## Compatibility issues
103 * Error messages and backtrace displays have been changed.
104 * Use a single quote instead of a backtick as a opening quote. [[Feature #16495]]
105 * Display a class name before a method name (only when the class has a permanent name). [[Feature #19117]]
106 * `Kernel#caller`, `Thread::Backtrace::Location`'s methods, etc. are also changed accordingly.
109 test.rb:1:in `foo': undefined method `time' for an instance of Integer
110 from test.rb:2:in `<main>'
113 test.rb:1:in 'Object#foo': undefined method 'time' for an instance of Integer
114 from test.rb:2:in `<main>'
117 ## Stdlib compatibility issues
121 * `rb_newobj` and `rb_newobj_of` (and corresponding macros `RB_NEWOBJ`, `RB_NEWOBJ_OF`, `NEWOBJ`, `NEWOBJ_OF`) have been removed. [[Feature #20265]]
122 * Removed deprecated function `rb_gc_force_recycle`. [[Feature #18290]]
124 ## Implementation improvements
126 * `Array#each` is rewritten in Ruby for better performance [[Feature #20182]].
130 ## Miscellaneous changes
132 * Passing a block to a method which doesn't use the passed block will show
133 a warning on verbose mode (`-w`).
136 * Redefining some core methods that are specially optimized by the interpreter
137 and JIT like `String.freeze` or `Integer#+` now emits a performance class
138 warning (`-W:performance` or `Warning[:performance] = true`).
141 [Feature #13557]: https://bugs.ruby-lang.org/issues/13557
142 [Feature #15554]: https://bugs.ruby-lang.org/issues/15554
143 [Feature #16495]: https://bugs.ruby-lang.org/issues/16495
144 [Feature #18290]: https://bugs.ruby-lang.org/issues/18290
145 [Feature #18980]: https://bugs.ruby-lang.org/issues/18980
146 [Misc #18984]: https://bugs.ruby-lang.org/issues/18984
147 [Feature #19117]: https://bugs.ruby-lang.org/issues/19117
148 [Bug #19918]: https://bugs.ruby-lang.org/issues/19918
149 [Bug #20064]: https://bugs.ruby-lang.org/issues/20064
150 [Feature #20182]: https://bugs.ruby-lang.org/issues/20182
151 [Feature #20205]: https://bugs.ruby-lang.org/issues/20205
152 [Bug #20218]: https://bugs.ruby-lang.org/issues/20218
153 [Feature #20265]: https://bugs.ruby-lang.org/issues/20265
154 [Feature #20429]: https://bugs.ruby-lang.org/issues/20429