rbs 1.6.2 → 1.7.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +0 -4
  3. data/.gitignore +1 -0
  4. data/CHANGELOG.md +6 -0
  5. data/Gemfile +1 -0
  6. data/Rakefile +7 -22
  7. data/core/kernel.rbs +4 -4
  8. data/core/trace_point.rbs +1 -1
  9. data/ext/rbs/extension/constants.c +140 -0
  10. data/ext/rbs/extension/constants.h +72 -0
  11. data/ext/rbs/extension/extconf.rb +3 -0
  12. data/ext/rbs/extension/lexer.c +1070 -0
  13. data/ext/rbs/extension/lexer.h +145 -0
  14. data/ext/rbs/extension/location.c +295 -0
  15. data/ext/rbs/extension/location.h +59 -0
  16. data/ext/rbs/extension/main.c +9 -0
  17. data/ext/rbs/extension/parser.c +2418 -0
  18. data/ext/rbs/extension/parser.h +23 -0
  19. data/ext/rbs/extension/parserstate.c +313 -0
  20. data/ext/rbs/extension/parserstate.h +141 -0
  21. data/ext/rbs/extension/rbs_extension.h +40 -0
  22. data/ext/rbs/extension/ruby_objs.c +585 -0
  23. data/ext/rbs/extension/ruby_objs.h +46 -0
  24. data/ext/rbs/extension/unescape.c +65 -0
  25. data/goodcheck.yml +1 -1
  26. data/lib/rbs/ast/comment.rb +0 -12
  27. data/lib/rbs/buffer.rb +4 -0
  28. data/lib/rbs/cli.rb +5 -8
  29. data/lib/rbs/collection/sources/git.rb +18 -3
  30. data/lib/rbs/errors.rb +14 -1
  31. data/lib/rbs/location.rb +221 -217
  32. data/lib/rbs/location_aux.rb +108 -0
  33. data/lib/rbs/locator.rb +10 -7
  34. data/lib/rbs/parser_aux.rb +24 -0
  35. data/lib/rbs/types.rb +2 -3
  36. data/lib/rbs/version.rb +1 -1
  37. data/lib/rbs/writer.rb +4 -2
  38. data/lib/rbs.rb +3 -7
  39. data/rbs.gemspec +2 -1
  40. data/sig/ancestor_builder.rbs +2 -2
  41. data/sig/annotation.rbs +2 -2
  42. data/sig/comment.rbs +7 -7
  43. data/sig/constant_table.rbs +1 -1
  44. data/sig/declarations.rbs +9 -9
  45. data/sig/definition.rbs +1 -1
  46. data/sig/definition_builder.rbs +2 -2
  47. data/sig/errors.rbs +30 -25
  48. data/sig/location.rbs +42 -79
  49. data/sig/locator.rbs +2 -2
  50. data/sig/members.rbs +7 -7
  51. data/sig/method_types.rbs +3 -3
  52. data/sig/parser.rbs +11 -21
  53. data/sig/types.rbs +45 -27
  54. data/sig/writer.rbs +1 -1
  55. data/stdlib/json/0/json.rbs +3 -3
  56. metadata +24 -6
  57. data/lib/rbs/parser.rb +0 -3614
data/sig/location.rbs CHANGED
@@ -1,17 +1,24 @@
1
1
  module RBS
2
2
  # Location is the range on buffer, `start_pos..end_pos`.
3
3
  # The index is based on characters.
4
- class Location
4
+ #
5
+ # A location can have _child_ locations.
6
+ #
7
+ # ```
8
+ #
9
+ # ```
10
+ #
11
+ class Location[RequiredChildKeys, OptionalChildKeys]
5
12
  # The buffer this location points on.
6
- attr_reader buffer: Buffer
13
+ attr_reader buffer (): Buffer
7
14
 
8
15
  # The index of character the range starts from.
9
- attr_reader start_pos: Integer
16
+ attr_reader start_pos (): Integer
10
17
 
11
18
  # The index of character the range ends at.
12
- attr_reader end_pos: Integer
19
+ attr_reader end_pos (): Integer
13
20
 
14
- def initialize: (buffer: Buffer, start_pos: Integer, end_pos: Integer) -> void
21
+ def initialize: (Buffer, Integer start_pos, Integer end_pos) -> void
15
22
 
16
23
  def inspect: () -> String
17
24
 
@@ -19,22 +26,22 @@ module RBS
19
26
  def name: () -> untyped
20
27
 
21
28
  # Line of the `start_pos` (1 origin)
22
- def start_line: () -> Integer
29
+ attr_reader start_line (): Integer
23
30
 
24
31
  # Column of the `start_pos` (0 origin)
25
- def start_column: () -> Integer
32
+ attr_reader start_column (): Integer
26
33
 
27
34
  # Line of the `end_pos` (1 origin)
28
- def end_line: () -> Integer
35
+ attr_reader end_line (): Integer
29
36
 
30
37
  # Column of the `end_pos` (0 origin)
31
- def end_column: () -> Integer
38
+ attr_reader end_column (): Integer
32
39
 
33
- def start_loc: () -> Buffer::loc
40
+ attr_reader start_loc (): Buffer::loc
34
41
 
35
- def end_loc: () -> Buffer::loc
42
+ attr_reader end_loc (): Buffer::loc
36
43
 
37
- def range: () -> Range[Integer]
44
+ attr_reader range (): Range[Integer]
38
45
 
39
46
  # A substring of buffer associated to the location.
40
47
  def source: () -> String
@@ -46,88 +53,44 @@ module RBS
46
53
  # Location.to_string(loc) # => a.rb:1:0...3:4
47
54
  # Location.to_string(nil) # => *:*:*..*:*
48
55
  #
49
- def self.to_string: (Location? location, ?default: ::String default) -> String
56
+ def self.to_string: (Location[untyped, untyped]? location, ?default: ::String default) -> String
50
57
 
51
58
  def ==: (untyped other) -> bool
52
59
 
53
- # Returns a new location with starting positionof `self` and ending position of `other`.
54
- #
55
- # l1 = Location.new(buffer: buffer, start_pos: 0, end_pox: x)
56
- # l2 = Location.new(buffer: buffer, start_pos: y, end_pos: 20)
57
- # l1 + l2 # => Location.new(buffer: buffer, start_pos: 0, end_pos: 20)
58
- #
59
- def +: (Location other) -> Location
60
-
61
- # Returns true if `loc` is exact predecessor of `self`.
62
- #
63
- # l1 = Location.new(...) # 0..10
64
- # l2 = Location.new(...) # 10..13
65
- # l3 = Location.new(...) # 13..20
66
- #
67
- # l1.pred?(l2) # => true
68
- # l2.pred?(l3) # => true
69
- # l1.pred?(l3) # => false
70
- #
71
- def pred?: (Location loc) -> bool
72
-
73
60
  include _ToJson
74
61
 
75
- # `<<` locations given as argument.
76
- #
77
- def concat: (*Location?) -> Location
78
-
79
- # Inplace version of `+`.
80
- #
81
- def <<: (Location?) -> Location
62
+ def add_optional_child: (OptionalChildKeys name, Range[Integer]? range) -> void
82
63
 
83
- # Returns WithChildren instance with given children.
84
- #
85
- # location.with_children(
86
- # required: { name: name.location },
87
- # optional: { args: nil }
88
- # )
89
- #
90
- def with_children: [R, O](?required: Hash[R, Range[Integer] | Location], ?optional: Hash[O, Range[Integer] | Location | nil]) -> WithChildren[R, O]
64
+ def add_required_child: (RequiredChildKeys name, Range[Integer] range) -> void
91
65
 
92
- # Location::WithChildren contains _child_ locations.
66
+ # Returns `Location` instance for given _child_ name.
93
67
  #
94
- # # Array[String]
95
- # # ^^^^^ <= name
96
- # # ^^^^^^^^ <= args
97
- # #
98
68
  # # @type var loc: Location::WithChildren[:name, :args]
99
- # loc = Location::WithChildren.new(buffer: buffer, start_pos: 0, end_pos: 13)
100
- # loc = loc.merge_required({ name: 1...5 })
101
- # loc = loc.merge_optional({ args: 5...13 })
69
+ # loc[:name] # => Location
70
+ # loc[:args] # => may be nil
102
71
  #
103
- # loc[:name] # => Location instance for `Array`
104
- # loc[:args] # => Location instance for `[String]`
72
+ # Note that passing unknown symbol raises an error even if the child is _optional_.
73
+ # You need explicitly set `nil` for absent optional children.
105
74
  #
106
- class WithChildren[RequiredChildKeys, OptionalChildKeys] < Location
107
- attr_reader required_children: Hash[RequiredChildKeys, Range[Integer]]
108
-
109
- attr_reader optional_children: Hash[OptionalChildKeys, Range[Integer]?]
75
+ def []: (RequiredChildKeys) -> Location[bot, bot]
76
+ | (OptionalChildKeys) -> Location[bot, bot]?
77
+ | (Symbol) -> Location[bot, bot]?
110
78
 
111
- def initialize: ...
79
+ def each_optional_key: () { (Symbol) -> void } -> void
80
+ | () -> Enumerator[Symbol, void]
112
81
 
113
- def initialize_copy: ...
82
+ def each_required_key: () { (Symbol) -> void } -> void
83
+ | () -> Enumerator[Symbol, void]
114
84
 
115
- # Returns `Location` instance for given _child_ name.
116
- #
117
- # # @type var loc: Location::WithChildren[:name, :args]
118
- # loc[:name] # => Location
119
- # loc[:args] # => may be nil
120
- #
121
- # Note that passing unknown symbol raises an error even if the child is _optional_.
122
- # You need explicitly set `nil` for absent optional children.
123
- #
124
- def []: (RequiredChildKeys) -> Location
125
- | (OptionalChildKeys) -> Location?
126
- | (Symbol) -> Location?
85
+ private
127
86
 
128
- def merge_required: (Hash[RequiredChildKeys, Range[Integer] | Location]) -> self
87
+ def _start_loc: () -> Buffer::loc?
88
+ def _end_loc: () -> Buffer::loc?
129
89
 
130
- def merge_optional: (Hash[OptionalChildKeys, Range[Integer] | Location | nil]) -> self
131
- end
90
+ def _add_required_child: (RequiredChildKeys name, Integer start_pos, Integer end_pos) -> void
91
+ def _add_optional_child: (OptionalChildKeys name, Integer start_pos, Integer end_pos) -> void
92
+ def _add_optional_no_child: (OptionalChildKeys name) -> void
93
+ def _optional_keys: () -> Array[Symbol]
94
+ def _required_keys: () -> Array[Symbol]
132
95
  end
133
96
  end
data/sig/locator.rbs CHANGED
@@ -37,8 +37,8 @@ module RBS
37
37
 
38
38
  def find_in_type: (Integer pos, type: Types::t, array: Array[component]) -> bool
39
39
 
40
- def find_in_loc: (Integer pos, location: Location::WithChildren[untyped, untyped] | Location | nil, array: Array[component]) -> bool
40
+ def find_in_loc: (Integer pos, location: Location[untyped, untyped]?, array: Array[component]) -> bool
41
41
 
42
- def test_loc: (Integer pos, location: Location?) -> bool
42
+ def test_loc: (Integer pos, location: Location[untyped, untyped]?) -> bool
43
43
  end
44
44
  end
data/sig/members.rbs CHANGED
@@ -25,7 +25,7 @@ module RBS
25
25
  # ^^^ name
26
26
  # ^^^ overload
27
27
  #
28
- type loc = Location::WithChildren[:keyword | :name, :kind | :overload]
28
+ type loc = Location[:keyword | :name, :kind | :overload]
29
29
 
30
30
  attr_reader name: Symbol
31
31
  attr_reader kind: kind
@@ -59,7 +59,7 @@ module RBS
59
59
  # ^^^^ name
60
60
  # ^ colon
61
61
  #
62
- type loc = Location::WithChildren[:name | :colon, :kind]
62
+ type loc = Location[:name | :colon, :kind]
63
63
 
64
64
  attr_reader name: Symbol
65
65
  attr_reader type: Types::t
@@ -97,7 +97,7 @@ module RBS
97
97
  # ^ arg_open
98
98
  # ^ arg_close
99
99
  #
100
- type loc = Location::WithChildren[:name | :keyword, :args]
100
+ type loc = Location[:name | :keyword, :args]
101
101
 
102
102
  attr_reader name: TypeName
103
103
  attr_reader args: Array[Types::t]
@@ -141,7 +141,7 @@ module RBS
141
141
  # ^^^^ ivar_name
142
142
  # ^ colon
143
143
  #
144
- type loc = Location::WithChildren[:keyword | :name | :colon, :kind | :ivar | :ivar_name]
144
+ type loc = Location[:keyword | :name | :colon, :kind | :ivar | :ivar_name]
145
145
 
146
146
  attr_reader name: Symbol
147
147
  attr_reader type: Types::t
@@ -174,9 +174,9 @@ module RBS
174
174
  end
175
175
 
176
176
  module LocationOnly
177
- attr_reader location: Location?
177
+ attr_reader location: Location[bot, bot]?
178
178
 
179
- def initialize: (location: Location?) -> void
179
+ def initialize: (location: Location[bot, bot]?) -> void
180
180
 
181
181
  include _HashEqual
182
182
  end
@@ -206,7 +206,7 @@ module RBS
206
206
  # ^^^^^ old_kind
207
207
  # ^^^ old_name
208
208
  #
209
- type loc = Location::WithChildren[:keyword | :new_name | :old_name, :new_kind | :old_kind]
209
+ type loc = Location[:keyword | :new_name | :old_name, :new_kind | :old_kind]
210
210
 
211
211
  attr_reader new_name: Symbol
212
212
  attr_reader old_name: Symbol
data/sig/method_types.rbs CHANGED
@@ -3,9 +3,9 @@ module RBS
3
3
  attr_reader type_params: Array[Symbol]
4
4
  attr_reader type: Types::Function
5
5
  attr_reader block: Types::Block?
6
- attr_reader location: Location?
6
+ attr_reader location: Location[untyped, untyped]?
7
7
 
8
- def initialize: (type_params: Array[Symbol], type: Types::Function, block: Types::Block?, location: Location?) -> void
8
+ def initialize: (type_params: Array[Symbol], type: Types::Function, block: Types::Block?, location: Location[untyped, untyped]?) -> void
9
9
 
10
10
  def ==: (untyped other) -> bool
11
11
 
@@ -13,7 +13,7 @@ module RBS
13
13
 
14
14
  def sub: (Substitution) -> MethodType
15
15
 
16
- def update: (?type_params: Array[Symbol], ?type: Types::Function, ?block: Types::Block?, ?location: Location?) -> MethodType
16
+ def update: (?type_params: Array[Symbol], ?type: Types::Function, ?block: Types::Block?, ?location: Location[untyped, untyped]?) -> MethodType
17
17
 
18
18
  def free_variables: (?Set[Symbol] set) -> Set[Symbol]
19
19
 
data/sig/parser.rbs CHANGED
@@ -1,32 +1,22 @@
1
1
  module RBS
2
2
  class Parser
3
- class SyntaxError < ParsingError
4
- attr_reader token_str: String
5
- attr_reader error_value: untyped
6
- attr_reader value_stack: untyped?
3
+ def self.parse_method_type: (Buffer | String, ?line: Integer, ?column: Integer, ?variables: Array[Symbol]) -> MethodType
7
4
 
8
- def initialize: (token_str: String, error_value: untyped, ?value_stack: untyped?) -> void
9
- end
5
+ def self.parse_type: (Buffer | String, ?line: Integer, ?column: Integer, ?variables: Array[Symbol]) -> Types::t
10
6
 
11
- class LexerError < ParsingError
12
- attr_reader input: String
13
- attr_reader location: Location
7
+ def self.parse_signature: (Buffer | String, ?line: Integer, ?column: Integer) -> Array[AST::Declarations::t]
14
8
 
15
- def initialize: (input: String, location: Location) -> void
16
- end
9
+ private
17
10
 
18
- class SemanticsError < ParsingError
19
- attr_reader subject: untyped
20
- attr_reader location: Location
21
- attr_reader original_message: String
11
+ def self.buffer: (String | Buffer source) -> Buffer
22
12
 
23
- def initialize: (String message, subject: untyped, location: Location) -> void
24
- end
13
+ %a{no-defn}
14
+ def self._parse_type: (Buffer, Integer line, Integer column, Array[Symbol] variables) -> Types::t
25
15
 
26
- def self.parse_method_type: (String | Buffer, ?variables: Array[Symbol], ?eof_re: Regexp?) -> MethodType
16
+ %a{no-defn}
17
+ def self._parse_method_type: (Buffer, Integer line, Integer column, Array[Symbol] variables) -> MethodType
27
18
 
28
- def self.parse_type: (String | Buffer, ?variables: Array[Symbol], ?eof_re: Regexp?) -> Types::t
29
-
30
- def self.parse_signature: (String | Buffer, ?eof_re: Regexp?) -> Array[AST::Declarations::t]
19
+ %a{no-defn}
20
+ def self._parse_signature: (Buffer, Integer line, Integer column) -> Array[AST::Declarations::t]
31
21
  end
32
22
  end
data/sig/types.rbs CHANGED
@@ -13,7 +13,7 @@ module RBS
13
13
  def sub: (Substitution) -> t
14
14
 
15
15
  # Maps type names included in the type and returns new instance of type.
16
- def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> t
16
+ def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> t
17
17
 
18
18
  # Yields all direct sub types included in the type.
19
19
  # It doesn't yield the type itself.
@@ -58,16 +58,16 @@ module RBS
58
58
  end
59
59
 
60
60
  module NoTypeName
61
- def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> self
61
+ def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> self
62
62
  end
63
63
 
64
64
  module Bases
65
65
  class Base
66
66
  include _TypeBase
67
67
 
68
- attr_reader location: Location?
68
+ attr_reader location: Location[bot, bot]?
69
69
 
70
- def initialize: (location: Location?) -> void
70
+ def initialize: (location: Location[bot, bot]?) -> void
71
71
 
72
72
  def ==: (untyped other) -> bool
73
73
 
@@ -111,6 +111,8 @@ module RBS
111
111
  end
112
112
 
113
113
  class Variable
114
+ type loc = Location[bot, bot]
115
+
114
116
  attr_reader name: Symbol
115
117
 
116
118
  @@count: Integer
@@ -119,9 +121,9 @@ module RBS
119
121
  include NoTypeName
120
122
  include EmptyEachType
121
123
 
122
- def initialize: (name: Symbol, location: Location?) -> void
124
+ def initialize: (name: Symbol, location: loc?) -> void
123
125
 
124
- attr_reader location: Location?
126
+ attr_reader location: loc?
125
127
 
126
128
  def ==: (untyped other) -> bool
127
129
 
@@ -144,7 +146,7 @@ module RBS
144
146
  class ClassSingleton
145
147
  # singleton(::Foo)
146
148
  # ^^^^^ => name
147
- type loc = Location::WithChildren[:name, bot]
149
+ type loc = Location[:name, bot]
148
150
 
149
151
  def initialize: (name: TypeName, location: loc?) -> void
150
152
 
@@ -189,7 +191,7 @@ module RBS
189
191
  # _Foo[Bar, Baz]
190
192
  # ^^^^ => name
191
193
  # ^^^^^^^^^^ => args
192
- type loc = Location::WithChildren[:name, :args]
194
+ type loc = Location[:name, :args]
193
195
 
194
196
  def initialize: (name: TypeName, args: Array[t], location: loc?) -> void
195
197
 
@@ -214,7 +216,8 @@ module RBS
214
216
  # Foo[Bar, Baz]
215
217
  # ^^^ => name
216
218
  # ^^^^^^^^^^ => args
217
- type loc = Location::WithChildren[:name, :args]
219
+ #
220
+ type loc = Location[:name, :args]
218
221
 
219
222
  def initialize: (name: TypeName, args: Array[t], location: loc?) -> void
220
223
 
@@ -226,54 +229,64 @@ module RBS
226
229
  class Alias
227
230
  attr_reader name: TypeName
228
231
 
229
- def initialize: (name: TypeName, location: Location?) -> void
232
+ type loc = Location[bot, bot]
233
+
234
+ def initialize: (name: TypeName, location: loc?) -> void
230
235
 
231
236
  include _TypeBase
232
237
  include NoFreeVariables
233
238
  include NoSubst
234
239
  include EmptyEachType
235
240
 
236
- attr_reader location: Location?
241
+ attr_reader location: loc?
237
242
  end
238
243
 
239
244
  class Tuple
240
245
  attr_reader types: Array[t]
241
246
 
242
- def initialize: (types: Array[t], location: Location?) -> void
247
+ type loc = Location[bot, bot]
248
+
249
+ def initialize: (types: Array[t], location: loc?) -> void
243
250
 
244
251
  include _TypeBase
245
252
 
246
- attr_reader location: Location?
253
+ attr_reader location: loc?
247
254
  end
248
255
 
249
256
  class Record
250
257
  attr_reader fields: Hash[Symbol, t]
251
258
 
252
- def initialize: (fields: Hash[Symbol, t], location: Location?) -> void
259
+ type loc = Location[bot, bot]
260
+
261
+ def initialize: (fields: Hash[Symbol, t], location: loc?) -> void
253
262
 
254
263
  include _TypeBase
255
264
 
256
- attr_reader location: Location?
265
+ attr_reader location: loc?
257
266
  end
258
267
 
259
268
  class Optional
260
269
  attr_reader type: t
261
270
 
262
- def initialize: (type: t, location: Location?) -> void
271
+ type loc = Location[bot, bot]
272
+
273
+ def initialize: (type: t, location: loc?) -> void
263
274
 
264
275
  include _TypeBase
265
276
 
266
- attr_reader location: Location?
277
+ attr_reader location: loc?
267
278
  end
268
279
 
269
280
  class Union
270
281
  attr_reader types: Array[t]
271
282
 
272
- def initialize: (types: Array[t], location: Location?) -> void
283
+ type loc = Location[bot, bot]
284
+
285
+ def initialize: (types: Array[t], location: loc?) -> void
273
286
 
274
287
  include _TypeBase
275
288
 
276
- attr_reader location: Location?
289
+ attr_reader location: loc?
277
290
 
278
291
  def map_type: () { (t) -> t } -> Union
279
292
  | () -> Enumerator[t, Union]
@@ -282,11 +295,13 @@ module RBS
282
295
  class Intersection
283
296
  attr_reader types: Array[t]
284
297
 
285
- def initialize: (types: Array[t], location: Location?) -> void
298
+ type loc = Location[bot, bot]
299
+
300
+ def initialize: (types: Array[t], location: loc?) -> void
286
301
 
287
302
  include _TypeBase
288
303
 
289
- attr_reader location: Location?
304
+ attr_reader location: loc?
290
305
 
291
306
  def map_type: () { (t) -> t } -> Intersection
292
307
  | () -> Enumerator[t, Intersection]
@@ -294,7 +309,7 @@ module RBS
294
309
 
295
310
  class Function
296
311
  class Param
297
- type loc = Location::WithChildren[bot, :name]
312
+ type loc = Location[bot, :name]
298
313
 
299
314
  attr_reader type: t
300
315
  attr_reader name: Symbol?
@@ -329,7 +344,7 @@ module RBS
329
344
  def map_type: { (t) -> t } -> Function
330
345
  | -> Enumerator[t, Function]
331
346
 
332
- def map_type_name: () { (TypeName, Location?, t) -> TypeName } -> Function
347
+ def map_type_name: () { (TypeName, Location[untyped, untyped]?, t) -> TypeName } -> Function
333
348
 
334
349
  def each_type: () { (t) -> void } -> void
335
350
  | -> Enumerator[t, void]
@@ -384,19 +399,22 @@ module RBS
384
399
  attr_reader type: Function
385
400
  attr_reader block: Block?
386
401
 
387
- def initialize: (location: Location?, type: Function, block: Block?) -> void
402
+ type loc = Location[bot, bot]
403
+
404
+ def initialize: (location: loc?, type: Function, block: Block?) -> void
388
405
 
389
406
  include _TypeBase
390
407
 
391
- attr_reader location: Location?
408
+ attr_reader location: loc?
392
409
  end
393
410
 
394
411
  class Literal
395
412
  type literal = String | Integer | Symbol | TrueClass | FalseClass
413
+ type loc = Location[bot, bot]
396
414
 
397
415
  attr_reader literal: literal
398
416
 
399
- def initialize: (literal: literal, location: Location?) -> void
417
+ def initialize: (literal: literal, location: loc?) -> void
400
418
 
401
419
  include _TypeBase
402
420
  include NoFreeVariables
@@ -404,7 +422,7 @@ module RBS
404
422
  include EmptyEachType
405
423
  include NoTypeName
406
424
 
407
- attr_reader location: Location?
425
+ attr_reader location: loc?
408
426
  end
409
427
  end
410
428
  end