rbs 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/Rakefile +2 -0
- data/core/array.rbs +1 -1
- data/core/enumerable.rbs +1 -1
- data/core/hash.rbs +13 -5
- data/core/io.rbs +3 -3
- data/core/module.rbs +1 -1
- data/core/numeric.rbs +10 -0
- data/core/proc.rbs +1 -1
- data/core/random.rbs +4 -2
- data/core/range.rbs +2 -2
- data/core/struct.rbs +3 -2
- data/core/thread.rbs +1 -1
- data/docs/CONTRIBUTING.md +5 -3
- data/docs/sigs.md +18 -1
- data/docs/syntax.md +11 -11
- data/lib/rbs.rb +1 -0
- data/lib/rbs/ast/annotation.rb +2 -2
- data/lib/rbs/ast/comment.rb +2 -2
- data/lib/rbs/ast/declarations.rb +37 -22
- data/lib/rbs/ast/members.rb +26 -26
- data/lib/rbs/cli.rb +3 -0
- data/lib/rbs/constant_table.rb +4 -1
- data/lib/rbs/definition.rb +1 -1
- data/lib/rbs/definition_builder.rb +14 -0
- data/lib/rbs/definition_builder/ancestor_builder.rb +1 -0
- data/lib/rbs/definition_builder/method_builder.rb +4 -2
- data/lib/rbs/location.rb +106 -2
- data/lib/rbs/locator.rb +205 -0
- data/lib/rbs/method_type.rb +2 -2
- data/lib/rbs/parser.rb +1050 -713
- data/lib/rbs/parser.y +403 -71
- data/lib/rbs/test/hook.rb +8 -2
- data/lib/rbs/type_name.rb +2 -3
- data/lib/rbs/type_name_resolver.rb +1 -1
- data/lib/rbs/types.rb +36 -34
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/writer.rb +4 -2
- data/sig/annotation.rbs +1 -1
- data/sig/cli.rbs +31 -21
- data/sig/comment.rbs +1 -1
- data/sig/declarations.rbs +106 -21
- data/sig/environment.rbs +2 -2
- data/sig/location.rbs +84 -3
- data/sig/locator.rbs +44 -0
- data/sig/members.rbs +76 -12
- data/sig/method_builder.rbs +1 -1
- data/sig/method_types.rbs +1 -1
- data/sig/polyfill.rbs +13 -8
- data/sig/rbs.rbs +8 -4
- data/sig/typename.rbs +1 -1
- data/sig/types.rbs +60 -19
- data/sig/util.rbs +0 -4
- data/sig/writer.rbs +8 -2
- data/stdlib/rubygems/0/requirement.rbs +84 -2
- data/stdlib/rubygems/0/version.rbs +2 -1
- data/stdlib/shellwords/0/shellwords.rbs +252 -0
- data/steep/Gemfile.lock +16 -13
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3be8bb7e853829dddbff29b1a3337a33fd61e2860f6c83771dfdbe2ad097eb75
|
4
|
+
data.tar.gz: e569b69fe73f92c80e621521be85e8292fdb43a14d4f1fdc8f7537cdd04efbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53895724feba94cfc7695ee7013f7cfa83618d566f4eec14fab0b5bed00074cda0394668a92d1f9eaa572bc3f0d8099a2f0bf201b05a444b3b2b8201c797ed48
|
7
|
+
data.tar.gz: 924a8b04e9b88464b5443fc1b8269cd20cfbfb25e04cc93737d52bbe1b4a895ac389371e373129ac6238a1152369ce71c3cca9183608fc9cebca4f571effc018
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,40 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.2.0 (2021-04-21)
|
6
|
+
|
7
|
+
### Summary
|
8
|
+
|
9
|
+
RBS 1.2 ships with better support for AST/token locations and `Locator` utility class. The AST objects now keep the locations of tokens. The `Locator` class is to translate the text position (line and column) to semantic object at the location. The class allows to find if a text position is on the class name of a class declaration.
|
10
|
+
|
11
|
+
### Signature updates
|
12
|
+
|
13
|
+
* Hash ([#631](https://github.com/ruby/rbs/pull/631), [#632](https://github.com/ruby/rbs/pull/632), [\#637](https://github.com/ruby/rbs/pull/637), [\#638](https://github.com/ruby/rbs/pull/638), [\#639](https://github.com/ruby/rbs/pull/639), )
|
14
|
+
* Module ([\#645](https://github.com/ruby/rbs/pull/645))
|
15
|
+
* Enumerable ([\#647](https://github.com/ruby/rbs/pull/647))
|
16
|
+
* Array ([\#648](https://github.com/ruby/rbs/pull/648))
|
17
|
+
* Proc ([\#649](https://github.com/ruby/rbs/pull/649))
|
18
|
+
* Struct ([\#650](https://github.com/ruby/rbs/pull/650), [\#668](https://github.com/ruby/rbs/pull/668))
|
19
|
+
* Thread ([\#651](https://github.com/ruby/rbs/pull/651))
|
20
|
+
* Random ([\#669](https://github.com/ruby/rbs/pull/669))
|
21
|
+
* Shellwords ([\#665](https://github.com/ruby/rbs/pull/665))
|
22
|
+
* IO ([\#659](https://github.com/ruby/rbs/pull/659))
|
23
|
+
|
24
|
+
### Language updates
|
25
|
+
|
26
|
+
* Module self type syntax update ([\#653](https://github.com/ruby/rbs/pull/653))
|
27
|
+
|
28
|
+
### Library changes
|
29
|
+
|
30
|
+
* Token locations ([\#666](https://github.com/ruby/rbs/pull/666))
|
31
|
+
* Add RBS::Locator ([\#667](https://github.com/ruby/rbs/pull/667))
|
32
|
+
* Fix runtime type checker ([\#644](https://github.com/ruby/rbs/pull/644))
|
33
|
+
|
34
|
+
### Miscellaneous
|
35
|
+
|
36
|
+
* Update documentation for overloading ([\#658](https://github.com/ruby/rbs/pull/658))
|
37
|
+
* Update target ruby version ([\#633](https://github.com/ruby/rbs/pull/633))
|
38
|
+
|
5
39
|
## 1.1.1 (2021-03-12)
|
6
40
|
|
7
41
|
### Signature updates
|
data/Rakefile
CHANGED
data/core/array.rbs
CHANGED
data/core/enumerable.rbs
CHANGED
@@ -118,7 +118,7 @@ module Enumerable[unchecked out Elem]: _Each[Elem]
|
|
118
118
|
# [].first(10) #=> []
|
119
119
|
# ```
|
120
120
|
def first: () -> Elem?
|
121
|
-
| (
|
121
|
+
| (_ToInt n) -> ::Array[Elem]
|
122
122
|
|
123
123
|
def grep: (untyped arg0) -> ::Array[Elem]
|
124
124
|
| [U] (untyped arg0) { (Elem arg0) -> U } -> ::Array[U]
|
data/core/hash.rbs
CHANGED
@@ -256,7 +256,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
256
256
|
# h.compact #=> { a: 1, b: false }
|
257
257
|
# h #=> { a: 1, b: false, c: nil }
|
258
258
|
#
|
259
|
-
def compact: () ->
|
259
|
+
def compact: () -> ::Hash[K, V]
|
260
260
|
|
261
261
|
# Removes all nil values from the hash. Returns nil if no changes were made,
|
262
262
|
# otherwise returns the hash.
|
@@ -450,6 +450,14 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
450
450
|
#
|
451
451
|
def eql?: (untyped) -> bool
|
452
452
|
|
453
|
+
# Returns a hash excluded given keys and the values.
|
454
|
+
#
|
455
|
+
# h = { a: 100, b: 200, c: 300 }
|
456
|
+
# h.except(:a) #=> {:b=>200, :c=>300}
|
457
|
+
# h.except(:b, :c, :d) #=> {:a=>100}
|
458
|
+
#
|
459
|
+
def except: (*K) -> ::Hash[K, V]
|
460
|
+
|
453
461
|
# Returns a value from the hash for the given key. If the key can't be found,
|
454
462
|
# there are several options: With no other arguments, it will raise a KeyError
|
455
463
|
# exception; if *default* is given, then that will be returned; if the optional
|
@@ -498,8 +506,8 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
498
506
|
#
|
499
507
|
# Hash#filter is an alias for Hash#select.
|
500
508
|
#
|
501
|
-
def filter: () { (K, V) -> boolish } ->
|
502
|
-
| () -> ::Enumerator[[ K, V ],
|
509
|
+
def filter: () { (K, V) -> boolish } -> ::Hash[K, V]
|
510
|
+
| () -> ::Enumerator[[ K, V ], ::Hash[K, V]]
|
503
511
|
|
504
512
|
# Equivalent to Hash#keep_if, but returns `nil` if no changes were made.
|
505
513
|
#
|
@@ -815,7 +823,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
815
823
|
# h.slice(:a) #=> {:a=>100}
|
816
824
|
# h.slice(:b, :c, :d) #=> {:b=>200, :c=>300}
|
817
825
|
#
|
818
|
-
def slice: (*K) ->
|
826
|
+
def slice: (*K) -> ::Hash[K, V]
|
819
827
|
|
820
828
|
# ## Element Assignment
|
821
829
|
#
|
@@ -857,7 +865,7 @@ class Hash[unchecked out K, unchecked out V] < Object
|
|
857
865
|
|
858
866
|
# Returns `self`.
|
859
867
|
#
|
860
|
-
def to_hash: () ->
|
868
|
+
def to_hash: () -> self
|
861
869
|
|
862
870
|
# Returns a Proc which maps keys to values.
|
863
871
|
#
|
data/core/io.rbs
CHANGED
@@ -181,7 +181,7 @@ class IO < Object
|
|
181
181
|
# # ...
|
182
182
|
# f.gets # won't cause Errno::EBADF
|
183
183
|
#
|
184
|
-
def autoclose=: (
|
184
|
+
def autoclose=: (boolish) -> untyped
|
185
185
|
|
186
186
|
# Returns `true` if the underlying file descriptor of *ios* will be closed
|
187
187
|
# automatically at its finalization, otherwise `false`.
|
@@ -212,7 +212,7 @@ class IO < Object
|
|
212
212
|
# just ignored since Ruby 2.3.
|
213
213
|
def close: () -> NilClass
|
214
214
|
|
215
|
-
def close_on_exec=: (boolish) ->
|
215
|
+
def close_on_exec=: (boolish) -> untyped
|
216
216
|
|
217
217
|
# Returns `true` if *ios* will be closed on exec.
|
218
218
|
#
|
@@ -656,7 +656,7 @@ class IO < Object
|
|
656
656
|
# ```
|
657
657
|
def sync: () -> bool
|
658
658
|
|
659
|
-
def sync=: (boolish) ->
|
659
|
+
def sync=: (boolish) -> untyped
|
660
660
|
|
661
661
|
def sysread: (Integer maxlen, String outbuf) -> String
|
662
662
|
|
data/core/module.rbs
CHANGED
@@ -158,7 +158,7 @@ class Module < Object
|
|
158
158
|
#
|
159
159
|
# Exiting with code 99
|
160
160
|
#
|
161
|
-
def alias_method: (Symbol new_name, Symbol old_name) ->
|
161
|
+
def alias_method: (::Symbol | ::String new_name, ::Symbol | ::String old_name) -> ::Symbol
|
162
162
|
|
163
163
|
# Returns a list of modules included/prepended in *mod* (including *mod*
|
164
164
|
# itself).
|
data/core/numeric.rbs
CHANGED
@@ -82,10 +82,20 @@ class Numeric
|
|
82
82
|
#
|
83
83
|
def %: (Numeric) -> Numeric
|
84
84
|
|
85
|
+
# Performs addition: the class of the resulting object depends on the class of
|
86
|
+
# `numeric`.
|
87
|
+
#
|
88
|
+
def +: (Numeric) -> Numeric
|
89
|
+
|
85
90
|
# Unary Plus---Returns the receiver.
|
86
91
|
#
|
87
92
|
def +@: () -> Numeric
|
88
93
|
|
94
|
+
# Performs subtraction: the class of the resulting object depends on the class
|
95
|
+
# of `numeric`.
|
96
|
+
#
|
97
|
+
def -: (Numeric) -> Numeric
|
98
|
+
|
89
99
|
# Unary Minus---Returns the receiver, negated.
|
90
100
|
#
|
91
101
|
def -@: () -> Numeric
|
data/core/proc.rbs
CHANGED
data/core/random.rbs
CHANGED
@@ -106,7 +106,9 @@ class Random < Object
|
|
106
106
|
|
107
107
|
# Alias of Random::DEFAULT.rand.
|
108
108
|
#
|
109
|
-
def self.rand: (
|
109
|
+
def self.rand: () -> Float
|
110
|
+
| (Integer | ::Range[Integer] max) -> Integer
|
111
|
+
| (Float | ::Range[Float] max) -> Float
|
110
112
|
|
111
113
|
# Seeds the system pseudo-random number generator, Random::DEFAULT, with
|
112
114
|
# `number`. The previous seed value is returned.
|
@@ -126,7 +128,7 @@ class Random < Object
|
|
126
128
|
# srand 1234 # => 1234
|
127
129
|
# [ rand, rand ] # => [0.1915194503788923, 0.6221087710398319]
|
128
130
|
#
|
129
|
-
def self.srand: (?Integer number) ->
|
131
|
+
def self.srand: (?Integer number) -> Integer
|
130
132
|
end
|
131
133
|
|
132
134
|
# The default Pseudorandom number generator. Used by class methods of Random.
|
data/core/range.rbs
CHANGED
@@ -99,7 +99,7 @@ class Range[out Elem] < Object
|
|
99
99
|
# ```ruby
|
100
100
|
# (1..10).begin #=> 1
|
101
101
|
# ```
|
102
|
-
def begin: () -> Elem
|
102
|
+
def begin: () -> Elem # Begin-less ranges have type of Range[Integer?]
|
103
103
|
|
104
104
|
def bsearch: [U] () { (Elem) -> boolish } -> U?
|
105
105
|
|
@@ -114,7 +114,7 @@ class Range[out Elem] < Object
|
|
114
114
|
# (1..10).end #=> 10
|
115
115
|
# (1...10).end #=> 10
|
116
116
|
# ```
|
117
|
-
def `end`: () -> Elem
|
117
|
+
def `end`: () -> Elem # End-less ranges have type of Range[Integer?]
|
118
118
|
|
119
119
|
# Returns `true` if the range excludes its end value.
|
120
120
|
#
|
data/core/struct.rbs
CHANGED
@@ -27,13 +27,14 @@
|
|
27
27
|
# struct member which is either a quoted string ( `"name"` ) or a
|
28
28
|
# [Symbol](https://ruby-doc.org/core-2.6.3/Symbol.html) ( `:name` ).
|
29
29
|
class Struct[Elem] < Object
|
30
|
-
include Enumerable[Elem]
|
30
|
+
include Enumerable[Elem?]
|
31
31
|
|
32
32
|
type attribute_name = Symbol | String
|
33
33
|
|
34
34
|
def initialize: (attribute_name, *attribute_name, ?keyword_init: boolish) ?{ () -> void } -> void
|
35
35
|
|
36
|
-
def each: ()
|
36
|
+
def each: () -> ::Enumerator[Elem?, self]
|
37
|
+
| () { (Elem? item) -> void } -> self
|
37
38
|
|
38
39
|
def self.members: () -> ::Array[Symbol]
|
39
40
|
end
|
data/core/thread.rbs
CHANGED
@@ -842,7 +842,7 @@ class Thread < Object
|
|
842
842
|
# However, if class [Thread](Thread.downloaded.ruby_doc) is subclassed,
|
843
843
|
# then calling `start` in that subclass will not invoke the subclass’s
|
844
844
|
# `initialize` method.
|
845
|
-
def self.start: (*untyped args) ->
|
845
|
+
def self.start: (*untyped args) { (*untyped) -> void } -> instance
|
846
846
|
|
847
847
|
# Stops execution of the current thread, putting it into a “sleep” state,
|
848
848
|
# and schedules execution of another thread.
|
data/docs/CONTRIBUTING.md
CHANGED
@@ -28,8 +28,8 @@
|
|
28
28
|
|
29
29
|
## The Target Version
|
30
30
|
|
31
|
-
* The standard library signatures targets Ruby
|
32
|
-
* The library code targets Ruby 2.
|
31
|
+
* The standard library signatures targets Ruby 3.0 for now.
|
32
|
+
* The library code targets Ruby 2.7 and 3.0.
|
33
33
|
|
34
34
|
## Stdlib Worksheet
|
35
35
|
|
@@ -60,6 +60,8 @@ You may find the *Good for first contributor* column where you can find some cla
|
|
60
60
|
Validate the syntax and some of the semantics.
|
61
61
|
* `rake generate:stdlib_test[String]`
|
62
62
|
Scaffold the stdlib test.
|
63
|
+
* `rake test/stdlib/Array_test.rb`
|
64
|
+
Run specific stdlib test with the path.
|
63
65
|
|
64
66
|
## Standard STDLIB Members Order
|
65
67
|
|
@@ -85,7 +87,7 @@ class HelloWorld[X]
|
|
85
87
|
|
86
88
|
public # Public instance methods
|
87
89
|
|
88
|
-
def each: () { (A) -> void } -> void # Members are sorted
|
90
|
+
def each: () { (A) -> void } -> void # Members are sorted dictionary order
|
89
91
|
|
90
92
|
def to_s: (?Locale) -> String
|
91
93
|
|
data/docs/sigs.md
CHANGED
@@ -26,7 +26,7 @@ The test installs instrumentations to spy the method calls and check if argument
|
|
26
26
|
If errors are reported by the test, you will fix the signature.
|
27
27
|
You will be sure that you ship a correct signature finally.
|
28
28
|
|
29
|
-
The instrumentations are
|
29
|
+
The instrumentations are implemented using `Module#prepend`.
|
30
30
|
It defines a module with same name of methods, which asserts the type of arguments/return values and calls `super`.
|
31
31
|
|
32
32
|
## Type errors
|
@@ -70,6 +70,23 @@ ERROR -- : [Kaigi::Conference#speakers] UnexpectedBlockError: unexpected block i
|
|
70
70
|
The error means there is a type error on overloaded methods.
|
71
71
|
The `rbs` test framework tries to the best error message for overloaded methods too, but it reports the `UnresolvedOverloadingError` when it fails.
|
72
72
|
|
73
|
+
### DuplicatedMethodDefinitionError
|
74
|
+
|
75
|
+
The error is reported when a method is defined multiple times, as RBS does not allow duplicate method definitions. When you need to overload a method, use the `...` syntax:
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
# First definition
|
79
|
+
class C
|
80
|
+
def foo: () -> untyped
|
81
|
+
end
|
82
|
+
|
83
|
+
# Second definition, use `...` syntax to tell RBS that we're overloading the method
|
84
|
+
class C
|
85
|
+
def foo: () -> untyped
|
86
|
+
| ...
|
87
|
+
end
|
88
|
+
```
|
89
|
+
|
73
90
|
## Setting up the test
|
74
91
|
|
75
92
|
The design of the signature testing aims to be non-intrusive. The setup is done in two steps:
|
data/docs/syntax.md
CHANGED
@@ -11,8 +11,8 @@ _type_ ::= _class-name_ _type-arguments_ (Class instance type)
|
|
11
11
|
| _type_ `|` _type_ (Union type)
|
12
12
|
| _type_ `&` _type_ (Intersection type)
|
13
13
|
| _type_ `?` (Optional type)
|
14
|
-
| `{` _record-name_ `:` _type_ `,`
|
15
|
-
| `[]` | `[` _type_ `,`
|
14
|
+
| `{` _record-name_ `:` _type_ `,` etc. `}` (Record type)
|
15
|
+
| `[]` | `[` _type_ `,` etc. `]` (Tuples)
|
16
16
|
| _type-variable_ (Type variables)
|
17
17
|
| `^(` _parameters_ `) ->` _type_ (Proc type)
|
18
18
|
| `self`
|
@@ -36,7 +36,7 @@ _namespace_ ::= (Empty namespace)
|
|
36
36
|
| _namespace_ /[A-Z]\w*/ `::` (Namespace)
|
37
37
|
|
38
38
|
_type-arguments_ ::= (No application)
|
39
|
-
| `[` _type_ `,`
|
39
|
+
| `[` _type_ `,` etc. `]` (Type application)
|
40
40
|
|
41
41
|
_literal_ ::= _string-literal_
|
42
42
|
| _symbol-literal_
|
@@ -203,7 +203,6 @@ We can see an example at the definition of `Enumerable#find`:
|
|
203
203
|
```
|
204
204
|
module Enumerable[Elem, Return]
|
205
205
|
def find: () { (Elem) -> boolish } -> Elem?
|
206
|
-
...
|
207
206
|
end
|
208
207
|
```
|
209
208
|
|
@@ -233,11 +232,11 @@ _parameters_ ::= _required-positionals_ _optional-positionals_ _rest-positional_
|
|
233
232
|
|
234
233
|
_parameter_ ::= _type_ _var-name_ # Parameter with var name
|
235
234
|
| _type_ # Parameter without var name
|
236
|
-
_required-positionals_ ::= _parameter_ `,`
|
237
|
-
_optional-positionals_ ::= `?` _parameter_ `,`
|
235
|
+
_required-positionals_ ::= _parameter_ `,` etc.
|
236
|
+
_optional-positionals_ ::= `?` _parameter_ `,` etc.
|
238
237
|
_rest-positional_ ::= # Empty
|
239
238
|
| `*` _parameter_
|
240
|
-
_trailing-positionals_ ::= _parameter_ `,`
|
239
|
+
_trailing-positionals_ ::= _parameter_ `,` etc.
|
241
240
|
_keywords_ ::= # Empty
|
242
241
|
| `**` _parameter_ # Rest keyword
|
243
242
|
| _keyword_ `:` _parameter_ `,` _keywords_ # Required keyword
|
@@ -292,9 +291,10 @@ _method-member_ ::= `def` _method-name_ `:` _method-types_ # Instance
|
|
292
291
|
_method-types_ ::= # Empty
|
293
292
|
| `super` # `super` overloading
|
294
293
|
| _type-parameters_ _method-type_ `|` _method-types_ # Overloading types
|
294
|
+
| `...` # Overloading for duplicate definitions
|
295
295
|
|
296
296
|
_type-parameters_ ::= # Empty
|
297
|
-
| `[` _type-variable_ `,`
|
297
|
+
| `[` _type-variable_ `,` etc. `]`
|
298
298
|
|
299
299
|
_attribute-member_ ::= _attribute-type_ _method-name_ `:` _type_ # Attribute
|
300
300
|
| _attribute-type_ _method-name_ `(` _ivar-name_ `) :` _type_ # Attribute with variable name specification
|
@@ -450,7 +450,7 @@ _const-name_ ::= _namespace_ /[A-Z]\w*/
|
|
450
450
|
_global-name_ ::= /$[a-zA-Z]\w+/ | ...
|
451
451
|
|
452
452
|
_module-type-parameters_ ::= # Empty
|
453
|
-
| `[` _module-type-parameter_ `,`
|
453
|
+
| `[` _module-type-parameter_ `,` etc. `]`
|
454
454
|
|
455
455
|
_module-type-parameter_ ::= _check_ _variance_ _type-variable_
|
456
456
|
_variance_ ::= `out` | `in`
|
@@ -475,7 +475,7 @@ For example, an `Array` of `String` can almost be considered to be an `Array` of
|
|
475
475
|
|
476
476
|
```
|
477
477
|
class Array[out T]
|
478
|
-
#
|
478
|
+
# etc.
|
479
479
|
end
|
480
480
|
```
|
481
481
|
|
@@ -486,7 +486,7 @@ In those cases, one must use the `unchecked` keyword:
|
|
486
486
|
|
487
487
|
```
|
488
488
|
class Array[unchecked out T]
|
489
|
-
#
|
489
|
+
# etc.
|
490
490
|
end
|
491
491
|
```
|
492
492
|
|
data/lib/rbs.rb
CHANGED
data/lib/rbs/ast/annotation.rb
CHANGED
data/lib/rbs/ast/comment.rb
CHANGED
@@ -19,8 +19,8 @@ module RBS
|
|
19
19
|
self.class.hash ^ string.hash
|
20
20
|
end
|
21
21
|
|
22
|
-
def to_json(
|
23
|
-
{ string: string, location: location }.to_json(
|
22
|
+
def to_json(state = _ = nil)
|
23
|
+
{ string: string, location: location }.to_json(state)
|
24
24
|
end
|
25
25
|
|
26
26
|
def concat(string:, location:)
|