Issue #15449 has been updated by zverok (Victor Shepelev).


According to [code](https://github.com/ruby/ruby/blob/trunk/range.c#L1287), it first tries to use `range_include_internal`, which has [special handling for strings](https://github.com/ruby/ruby/blob/trunk/range.c#L1330). 

Justification is not obvious, but probably it is an attempt to preserve backwards compatibility?

----------------------------------------
Bug #15449: Range#=== is not using cover in Ruby 2.6
https://bugs.ruby-lang.org/issues/15449#change-75826

* Author: ana06 (Ana Maria Martinez Gomez)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.0dev (2018-12-20 trunk 66466)
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
```
irb(main):105:0> ('A'..'Z').cover? 'ANA'
=> true
irb(main):106:0> ('A'..'Z') === 'ANA'
=> false

```

Is this expected? Should `===` use cover according to NEWS in Ruby 2.6?


```
> ruby -v
ruby 2.6.0dev (2018-12-20 trunk 66466) [x86_64-linux]
```




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