[ruby-core:94768] [Ruby master Bug#16140] non-typed variable

From: professeurx@...
Date: 2019-09-04 02:33:18 UTC
List: ruby-core #94768
Issue #16140 has been reported by professeurx (Fran輟ys Proulx).

----------------------------------------
Bug #16140: non-typed variable
https://bugs.ruby-lang.org/issues/16140

* Author: professeurx (Fran輟ys Proulx)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------

I not sure it's a bug. But maybe it's should be.

``` ruby
a =  2
puts a

a = "two"
puts a

=> 2
=> two
```
I was expecting to produce an error. After all Ruby is supposed to be a dynamically types language. Clearly for the variable it's not the case. if it's not a bug, it possibly an option to added to the interpreter.




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

In This Thread

Prev Next