Skip to content
  • Jeremy Evans's avatar
    04a92a67
    Raise TypeError for endless non-numeric range include? · 04a92a67
    Jeremy Evans authored
    Beginless ranges previously raised TypeError for this case,
    except for string ranges, which had unexpected behavior:
    
      ('a'..'z').include?('ww') # false
      (..'z').include?('ww') # previously true, now TypeError
    
    Use of include? with endless ranges could previously result
    in an infinite loop.
    
    This splits off a range_string_cover_internal function from
    range_include_internal.
    
    Fixes [Bug #18580]
    04a92a67
    Raise TypeError for endless non-numeric range include?
    Jeremy Evans authored
    Beginless ranges previously raised TypeError for this case,
    except for string ranges, which had unexpected behavior:
    
      ('a'..'z').include?('ww') # false
      (..'z').include?('ww') # previously true, now TypeError
    
    Use of include? with endless ranges could previously result
    in an infinite loop.
    
    This splits off a range_string_cover_internal function from
    range_include_internal.
    
    Fixes [Bug #18580]
Loading