Issue #13246 has been reported by Kir Shatrov.

----------------------------------------
Feature #13246: [REQUEST] Allow to make rb_compile_warn a hard error
https://bugs.ruby-lang.org/issues/13246

* Author: Kir Shatrov
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
~~~ bash
$ cat dup.rb
puts({ one: 1, one: 2})

$ ruby dup.rb
dup.rb:1: warning: key :one is duplicated and overwritten on line 1
{:one=>2}
~~~

I suppose it was initially made a warning for the backward compatibility reasons.

In case of our project, we'd like to raise on all warnings like this one and stop allowing developers to introduce the code with warnings.
This is a common error that developers make, especially when they use TDD and the test output is quite large and it's not easy to notice the warning.

I propose that we provide an API to catch `rb_compile_warn` events and allow to raise on them, or for instance report them to the exception notification library if it's running in production.



-- 
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>