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+ # FIXME: mruby/c only supports Range[Integer] only
2+ class Range [out Elem] < Object
3+ def === : (untyped other) -> bool
4+ def self.=== : (untyped other) -> bool
5+
6+ def first : () -> Elem
7+
8+ def last : () -> Elem
9+
10+ def exclude_end? : () -> bool
11+
12+ def inspect : () -> String
13+ def self.inspect : () -> String
14+
15+ alias to_s inspect
16+ alias self .to_s self .inspect
17+ end
Original file line number Diff line number Diff line change @@ -26,17 +26,15 @@ class String < Object
2626
2727 def << : (String) -> String
2828
29- # TODO: Range
3029 def slice : (Integer nth) -> String?
3130 | (Integer nth, Integer len) -> String?
32- # | (Range range) -> String?
31+ | (Range[Integer] range) -> String?
3332
3433 alias [] slice
3534
36- # TODO: Range
3735 def []= : (Integer nth, String val) -> String
3836 | (Integer nth, Integer len, String val) -> String
39- # | (Range range, String val) -> String
37+ | (Range[Integer] range, String val) -> String
4038
4139 def b : () -> String
4240
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ # rubocop:disable Lint/Void
4+ # rubocop:disable Style/CaseEquality
5+ # rubocop:disable Lint/BinaryOperatorWithIdenticalOperands
6+
7+ 0 ..10
8+
9+ ( 0 ..10 ) === ( 0 ..10 )
10+
11+ ( 0 ..10 ) . first
12+
13+ ( 0 ..10 ) . last
14+
15+ ( 0 ...10 ) . exclude_end?
16+
17+ ( 0 ..10 ) . inspect
18+ Range . inspect
19+
20+ ( 0 ..10 ) . to_s
21+ Range . to_s
22+
23+ # rubocop:enable all
Original file line number Diff line number Diff line change 4040
4141'abcdef' . slice 2
4242'abcdef' . slice 2 , 3
43+ 'abcdef' . slice 2 ..4
4344
4445'abcdef' [ 3 ]
4546'abcdef' [ 3 , 3 ]
47+ 'abcdef' [ 3 ...6 ]
4648
4749'abcdef' [ 3 ] = 'D'
4850'abcdef' [ 3 , 3 ] = 'defghi'
51+ 'abcdef' [ 3 ...6 ] = 'defghi'
4952
5053'abcdef' . b
5154
You can’t perform that action at this time.
0 commit comments