Issue #15974 has been updated by Eregon (Benoit Daloze).


chrisseaton (Chris Seaton) wrote:
> I think Ruby Spec considers warnings to be user-visible features, so does normally spec them. This prompts alternative implementations like JRuby and TruffleRuby to implement the same warning so that the user experience is the same on all implementations.
> 
> @eregon will be able to give a definitive opinion on whether it should be spec'd or not.

Yes, exactly, it's a useful feature for other implementations to have too and it's user-visible so it's good to add to ruby/spec, similar to warnings.

----------------------------------------
Feature #15974: Warn in verbose mode on defining a finalizer that captures the object
https://bugs.ruby-lang.org/issues/15974#change-79058

* Author: chrisseaton (Chris Seaton)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
There's a really common mistake people make when using `define_finalizer` - they capture the object in the finalizer.

https://www.mikeperham.com/2010/02/24/the-trouble-with-ruby-finalizers/

This PR warns about that, when in verbose mode (it's too slow to do always.)

https://github.com/ruby/ruby/pull/2264



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>