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 @@ -1427,6 +1427,7 @@ def to_s(level = 0)
14271427 def each_type ( &block )
14281428 if block
14291429 type . each_type ( &block )
1430+ yield self_type if self_type
14301431 self . block &.type &.each_type ( &block )
14311432 if self_type = self . block &.self_type
14321433 yield self_type
@@ -1467,7 +1468,7 @@ def has_classish_type?
14671468 end
14681469
14691470 def with_nonreturn_void?
1470- if type . with_nonreturn_void?
1471+ if type . with_nonreturn_void? || self_type &. with_nonreturn_void?
14711472 true
14721473 else
14731474 if block = block ( )
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def test_has_self_type?
4040 "[self]" ,
4141 "Array[self]" ,
4242 "^(self) -> void" ,
43+ "^() [self: self] -> void" ,
4344 "^() { () [self: self] -> void } -> void"
4445 ] . each do |str |
4546 type = parse_type ( str )
@@ -61,6 +62,7 @@ def test_has_classish_type?
6162 "class" ,
6263 "class?" ,
6364 "^() -> instance" ,
65+ "^() [self: class] -> void" ,
6466 "^() { () [self: class] -> void } -> void"
6567 ] . each do |str |
6668 type = parse_type ( str )
@@ -80,7 +82,8 @@ def test_with_nonreturn_void?
8082 [
8183 "void" ,
8284 "[void]" ,
83- "void?"
85+ "void?" ,
86+ "^() [self: void] -> void"
8487 ] . each do |str |
8588 type = parse_type ( str )
8689 assert_predicate type , :with_nonreturn_void?
You can’t perform that action at this time.
0 commit comments