Issue #12793 has been updated by Kazuhiro NISHIYAMA.


`Kernel#warn` accepts `nil` and `1`, but `Warning.warn` raises `TypeError`.
Is this difference expected?

```
% ruby -ve 'warn nil; Warning.warn nil'
ruby 2.4.0dev (2016-09-28 trunk 56281) [x86_64-linux]

-e:1:in `warn': wrong argument type nil (expected String) (TypeError)
        from -e:1:in `<main>'
% ruby -ve 'warn 1; Warning.warn 1'
ruby 2.4.0dev (2016-09-28 trunk 56281) [x86_64-linux]
1
-e:1:in `warn': wrong argument type Integer (expected String) (TypeError)
        from -e:1:in `<main>'
```

----------------------------------------
Bug #12793: Warning.warn with non-string object
https://bugs.ruby-lang.org/issues/12793#change-60711

* Author: Kazuhiro NISHIYAMA
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.4.0dev (2016-09-27 trunk 56273) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
`Warning.warn` with non-string argument causes SEGV.
For example, `Warning.warn nil`.



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