File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## update
2+ def foo
3+ x = :a
4+ begin
5+ x = :b
6+ raise
7+ x = :c
8+ rescue
9+ check_rescue ( x )
10+ x = :d
11+ # ensure # TODO: Looks like commenting out these two lines makes the test fail? Need to fix
12+ # x = :f
13+ else
14+ check_else ( x )
15+ x = :e
16+ end
17+ check_after ( x )
18+ end
19+
20+ def check_rescue ( n ) = nil
21+ def check_else ( n ) = nil
22+ def check_after ( n ) = nil
23+
24+ ## assert
25+ class Object
26+ def foo : -> nil
27+ def check_rescue : ( :a | :c ) -> nil
28+ def check_else : ( :c ) -> nil
29+ def check_after : ( :a | :c | :d | :e ) -> nil
30+ end
Original file line number Diff line number Diff line change 11## update
2- def bar ( n )
3- :c
4- end
5-
6- def foo ( n )
2+ def foo
73 begin
8- n = "str"
9- 1.0
10- rescue
114 :a
12- rescue SyntaxError
5+ rescue
136 :b
7+ rescue SyntaxError
8+ :c
149 rescue Exception
15- ## TODO: bar should accept "Integer | String" ???
16- bar ( n )
17- else
1810 :d
11+ else
12+ :e
1913 end
2014end
2115
22- def baz ( n )
16+ def bar ( n )
2317 n rescue :a
2418end
2519
26- foo ( 1 )
27- baz ( 1 )
20+ foo
21+ bar ( 1 )
2822
2923## assert
3024class Object
31- def bar : ( String ) -> :c
32- def foo : ( Integer ) -> ( :a | :b | :c | :d | Float )
33- def baz : ( Integer ) -> ( :a | Integer )
25+ def foo : -> ( :a | :b | :c | :d | :e )
26+ def bar : ( Integer ) -> ( :a | Integer )
3427end
You can’t perform that action at this time.
0 commit comments