File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2733,8 +2733,8 @@ class String
27332733 # <<cruel>> <<world>>
27342734 # rceu lowlr
27352735 #
2736- def scan : (Regexp pattern) -> Array[String | Array[String]]
2737- | (Regexp pattern) { (String | Array[String] matches) -> void } -> self
2736+ def scan : (Regexp pattern) -> Array[String | Array[String? ]]
2737+ | (Regexp pattern) { (String | Array[String? ] matches) -> void } -> self
27382738 | (string pattern) -> Array[String]
27392739 | (string pattern) { (String match) -> void } -> self
27402740
Original file line number Diff line number Diff line change @@ -1259,11 +1259,15 @@ def test_scan
12591259 'hello' , :scan , /l/
12601260 assert_send_type '(Regexp) -> Array[Array[String]]' ,
12611261 'hello' , :scan , /(l)/
1262+ assert_send_type '(Regexp) -> Array[Array[nil]]' ,
1263+ 'hello' , :scan , /(x)?/
12621264
12631265 assert_send_type '(Regexp) { (String) -> void } -> String' ,
12641266 'hello' , :scan , /l/ do end
12651267 assert_send_type '(Regexp) { (Array[String]) -> void } -> String' ,
12661268 'hello' , :scan , /(l)/ do end
1269+ assert_send_type '(Regexp) { (Array[nil]) -> void } -> String' ,
1270+ 'hello' , :scan , /(x)?/ do end
12671271
12681272 with_string 'l' do |pattern |
12691273 assert_send_type '(string) -> Array[String]' ,
You can’t perform that action at this time.
0 commit comments