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
@@ -0,0 +1,108 @@
1
+ module RBS
2
+ class Location
3
+ def inspect
4
+ rks = each_required_key.to_a
5
+ ops = each_optional_key.to_a.map {|x| "?#{x}" }
6
+ "#<#{self.class}:#{self.__id__} buffer=#{buffer.name}, start=#{start_line}:#{start_column}, pos=#{start_pos}...#{end_pos}, children=#{(rks + ops).join(",")} source='#{source.lines.first&.chomp}'>"
7
+ end
8
+
9
+ def name
10
+ buffer.name
11
+ end
12
+
13
+ def start_line
14
+ start_loc[0]
15
+ end
16
+
17
+ def start_column
18
+ start_loc[1]
19
+ end
20
+
21
+ def end_line
22
+ end_loc[0]
23
+ end
24
+
25
+ def end_column
26
+ end_loc[1]
27
+ end
28
+
29
+ def start_loc
30
+ @start_loc ||= begin
31
+ _start_loc || buffer.pos_to_loc(start_pos)
32
+ end
33
+ end
34
+
35
+ def end_loc
36
+ @end_loc ||= begin
37
+ _end_loc || buffer.pos_to_loc(end_pos)
38
+ end
39
+ end
40
+
41
+ def range
42
+ @range ||= start_pos...end_pos
43
+ end
44
+
45
+ def source
46
+ @source ||= buffer.content[range] or raise
47
+ end
48
+
49
+ def to_s
50
+ "#{name || "-"}:#{start_line}:#{start_column}...#{end_line}:#{end_column}"
51
+ end
52
+
53
+ def ==(other)
54
+ other.is_a?(Location) &&
55
+ other.buffer == buffer &&
56
+ other.start_pos == start_pos &&
57
+ other.end_pos == end_pos
58
+ end
59
+
60
+ def to_json(state = _ = nil)
61
+ {
62
+ start: {
63
+ line: start_line,
64
+ column: start_column
65
+ },
66
+ end: {
67
+ line: end_line,
68
+ column: end_column
69
+ },
70
+ buffer: {
71
+ name: name&.to_s
72
+ }
73
+ }.to_json(state)
74
+ end
75
+
76
+ def self.to_string(location, default: "*:*:*...*:*")
77
+ location&.to_s || default
78
+ end
79
+
80
+ def add_required_child(name, range)
81
+ _add_required_child(name, range.begin, range.end)
82
+ end
83
+
84
+ def add_optional_child(name, range)
85
+ if range
86
+ _add_optional_child(name, range.begin, range.end)
87
+ else
88
+ _add_optional_no_child(name);
89
+ end
90
+ end
91
+
92
+ def each_optional_key(&block)
93
+ if block
94
+ _optional_keys.uniq.each(&block)
95
+ else
96
+ enum_for(:each_optional_key)
97
+ end
98
+ end
99
+
100
+ def each_required_key(&block)
101
+ if block
102
+ _required_keys.uniq.each(&block)
103
+ else
104
+ enum_for(:each_required_key)
105
+ end
106
+ end
107
+ end
108
+ end
data/lib/rbs/locator.rb CHANGED
@@ -172,16 +172,19 @@ module RBS
172
172
 
173
173
  def find_in_loc(pos, location:, array:)
174
174
  if test_loc(pos, location: location)
175
- if location.is_a?(Location::WithChildren)
176
- location.optional_children.each do |key, range|
177
- if range === pos
178
- array.unshift(key)
179
- return true
175
+ if location.is_a?(Location)
176
+ location.each_optional_key do |key|
177
+ if loc = location[key]
178
+ if loc.range === pos
179
+ array.unshift(key)
180
+ return true
181
+ end
180
182
  end
181
183
  end
182
184
 
183
- location.required_children.each do |key, range|
184
- if range === pos
185
+ location.each_required_key do |key|
186
+ loc = location[key] or raise
187
+ if loc.range === pos
185
188
  array.unshift(key)
186
189
  return true
187
190
  end
@@ -0,0 +1,24 @@
1
+ module RBS
2
+ class Parser
3
+ def self.parse_type(source, line: 1, column: 0, variables: [])
4
+ _parse_type(buffer(source), line, column, variables)
5
+ end
6
+
7
+ def self.parse_method_type(source, line: 1, column: 0, variables: [])
8
+ _parse_method_type(buffer(source), line, column, variables)
9
+ end
10
+
11
+ def self.parse_signature(source, line: 1, column: 0)
12
+ _parse_signature(buffer(source), line, column)
13
+ end
14
+
15
+ def self.buffer(source)
16
+ case source
17
+ when String
18
+ Buffer.new(content: source, name: "a.rbs")
19
+ when Buffer
20
+ source
21
+ end
22
+ end
23
+ end
24
+ end
data/lib/rbs/types.rb CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  module RBS
3
2
  module Types
4
3
  module NoFreeVariables
@@ -434,7 +433,7 @@ module RBS
434
433
  return "{ }" if self.fields.empty?
435
434
 
436
435
  fields = self.fields.map do |key, type|
437
- if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && !key.match?(Parser::KEYWORDS_RE)
436
+ if key.is_a?(Symbol) && key.match?(/\A[A-Za-z_][A-Za-z_]*\z/) && !Parser::KEYWORDS.key?(key)
438
437
  "#{key}: #{type}"
439
438
  else
440
439
  "#{key.inspect} => #{type}"
@@ -691,7 +690,7 @@ module RBS
691
690
 
692
691
  def to_s
693
692
  if name
694
- if /\A#{Parser::KEYWORDS_RE}\z/.match?(name)
693
+ if Parser::KEYWORDS.key?(name)
695
694
  "#{type} `#{name}`"
696
695
  else
697
696
  "#{type} #{name}"
data/lib/rbs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RBS
2
- VERSION = "1.6.2"
2
+ VERSION = "1.7.0.beta.1"
3
3
  end
data/lib/rbs/writer.rb CHANGED
@@ -232,8 +232,10 @@ module RBS
232
232
  def method_name(name)
233
233
  s = name.to_s
234
234
 
235
- if [:tOPERATOR, :kAMP, :kHAT, :kSTAR, :kLT, :kEXCLAMATION, :kSTAR2, :kBAR].include?(Parser::PUNCTS[s]) ||
236
- (/\A[a-zA-Z_]\w*[?!=]?\z/.match?(s) && !/\Aself\??\z/.match?(s))
235
+ case s
236
+ when /\A(_?)[A-Za-z_]\w*(\?|!|=)?\Z/
237
+ s
238
+ when *%w(| ^ & <=> == === =~ > >= < <= << >> + - * / % ** ~ +@ -@ [] []= ` ! != !~)
237
239
  s
238
240
  else
239
241
  "`#{s}`"
data/lib/rbs.rb CHANGED
@@ -12,7 +12,6 @@ require "strscan"
12
12
  require "rbs/char_scanner"
13
13
  require "rbs/errors"
14
14
  require "rbs/buffer"
15
- require "rbs/location"
16
15
  require "rbs/namespace"
17
16
  require "rbs/type_name"
18
17
  require "rbs/types"
@@ -47,12 +46,9 @@ require "rbs/locator"
47
46
  require "rbs/type_alias_dependency"
48
47
  require "rbs/collection"
49
48
 
50
- begin
51
- require "rbs/parser"
52
- rescue LoadError
53
- STDERR.puts "Missing parser Ruby code? Running `rake parser` may solve the issue"
54
- raise
55
- end
49
+ require "rbs/extension"
50
+ require "rbs/parser_aux"
51
+ require "rbs/location_aux"
56
52
 
57
53
  module RBS
58
54
  class <<self
data/rbs.gemspec CHANGED
@@ -30,7 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
31
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
32
32
  end
33
- spec.files << "lib/rbs/parser.rb"
33
+ spec.extensions = %w{ext/rbs/extension/extconf.rb}
34
+
34
35
  spec.bindir = "exe"
35
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
37
  spec.require_paths = ["lib"]
@@ -82,7 +82,7 @@ module RBS
82
82
  def mixin_ancestors: (Environment::ClassEntry | Environment::ModuleEntry,
83
83
  TypeName,
84
84
  included_modules: Array[Definition::Ancestor::Instance]?,
85
- included_interfaces:Array[Definition::Ancestor::Instance]?,
85
+ included_interfaces: Array[Definition::Ancestor::Instance]?,
86
86
  prepended_modules: Array[Definition::Ancestor::Instance]?,
87
87
  extended_modules: Array[Definition::Ancestor::Instance]?,
88
88
  extended_interfaces: Array[Definition::Ancestor::Instance]?) -> void
@@ -91,7 +91,7 @@ module RBS
91
91
  TypeName,
92
92
  align_params: Substitution?,
93
93
  included_modules: Array[Definition::Ancestor::Instance]?,
94
- included_interfaces:Array[Definition::Ancestor::Instance]?,
94
+ included_interfaces: Array[Definition::Ancestor::Instance]?,
95
95
  prepended_modules: Array[Definition::Ancestor::Instance]?,
96
96
  extended_modules: Array[Definition::Ancestor::Instance]?,
97
97
  extended_interfaces: Array[Definition::Ancestor::Instance]?) -> void
data/sig/annotation.rbs CHANGED
@@ -10,9 +10,9 @@ module RBS
10
10
  #
11
11
  class Annotation
12
12
  attr_reader string: String
13
- attr_reader location: Location?
13
+ attr_reader location: Location[untyped, untyped]?
14
14
 
15
- def initialize: (string: String, location: Location?) -> void
15
+ def initialize: (string: String, location: Location[untyped, untyped]?) -> void
16
16
 
17
17
  def ==: (untyped other) -> bool
18
18
 
data/sig/comment.rbs CHANGED
@@ -2,15 +2,17 @@ module RBS
2
2
  module AST
3
3
  # RBS allows writing documentation of declarations and members.
4
4
  #
5
- # # This is a doc for class.
6
- # class Hello
7
- # end
5
+ # ```
6
+ # # This is a doc for class.
7
+ # class Hello
8
+ # end
9
+ # ```
8
10
  #
9
11
  class Comment
10
12
  attr_reader string: String
11
- attr_reader location: Location?
13
+ attr_reader location: Location[bot, bot]?
12
14
 
13
- def initialize: (string: String, location: Location?) -> void
15
+ def initialize: (string: String, location: Location[bot, bot]?) -> void
14
16
 
15
17
  def ==: (untyped other) -> bool
16
18
 
@@ -19,8 +21,6 @@ module RBS
19
21
  def hash: () -> Integer
20
22
 
21
23
  include _ToJson
22
-
23
- def concat: (string: String, location: Location?) -> self
24
24
  end
25
25
  end
26
26
  end
@@ -9,7 +9,7 @@ module RBS
9
9
 
10
10
  def absolute_type: (Types::t, context: Array[Namespace]) -> Types::t
11
11
 
12
- def absolute_type_name: (TypeName, context: Array[Namespace], location: Location?) -> TypeName
12
+ def absolute_type_name: (TypeName, context: Array[Namespace], location: Location[untyped, untyped]?) -> TypeName
13
13
 
14
14
  def name_to_constant: (TypeName) -> Constant?
15
15
 
data/sig/declarations.rbs CHANGED
@@ -17,7 +17,7 @@ module RBS
17
17
  # ^^^^^^^^^ unchecked
18
18
  # ^^^ variance
19
19
  # ^^^^ name
20
- type loc = Location::WithChildren[:name, :variance | :unchecked]
20
+ type loc = Location[:name, :variance | :unchecked]
21
21
 
22
22
  attr_reader name: Symbol
23
23
  attr_reader variance: variance
@@ -86,7 +86,7 @@ module RBS
86
86
  # ^^^^^ name
87
87
  # ^^^^^^^^ args
88
88
  #
89
- type loc = Location::WithChildren[:name, :args]
89
+ type loc = Location[:name, :args]
90
90
 
91
91
  attr_reader name: TypeName
92
92
  attr_reader args: Array[Types::t]
@@ -112,7 +112,7 @@ module RBS
112
112
  # ^ lt
113
113
  # ^^^ end
114
114
  #
115
- type loc = Location::WithChildren[:keyword | :name | :end, :type_params | :lt]
115
+ type loc = Location[:keyword | :name | :end, :type_params | :lt]
116
116
 
117
117
  include NestedDeclarationHelper
118
118
  include MixinHelper
@@ -137,7 +137,7 @@ module RBS
137
137
  # ^^^^^ name
138
138
  # ^^^^^^^^ args
139
139
  #
140
- type loc = Location::WithChildren[:name, :args]
140
+ type loc = Location[:name, :args]
141
141
 
142
142
  attr_reader name: TypeName
143
143
  attr_reader args: Array[Types::t]
@@ -166,7 +166,7 @@ module RBS
166
166
  # ^^^^^^^^^^^ self_types
167
167
  # ^^^ end
168
168
  #
169
- type loc = Location::WithChildren[:keyword | :name | :end, :type_params | :colon | :self_types]
169
+ type loc = Location[:keyword | :name | :end, :type_params | :colon | :self_types]
170
170
 
171
171
  include NestedDeclarationHelper
172
172
  include MixinHelper
@@ -199,7 +199,7 @@ module RBS
199
199
  # ^^^^^^ type_params
200
200
  # ^^^ end
201
201
  #
202
- type loc = Location::WithChildren[:name | :keyword | :end, :type_params]
202
+ type loc = Location[:name | :keyword | :end, :type_params]
203
203
 
204
204
  attr_reader name: TypeName
205
205
  attr_reader type_params: ModuleTypeParams
@@ -221,7 +221,7 @@ module RBS
221
221
  # ^^^^ keyword
222
222
  # ^^^ name
223
223
  # ^ eq
224
- type loc = Location::WithChildren[:keyword | :name | :eq, bot]
224
+ type loc = Location[:keyword | :name | :eq, bot]
225
225
 
226
226
  attr_reader name: TypeName
227
227
  attr_reader type: Types::t
@@ -240,7 +240,7 @@ module RBS
240
240
  # ^^^^^^^ name
241
241
  # ^ colon
242
242
  #
243
- type loc = Location::WithChildren[:name | :colon, bot]
243
+ type loc = Location[:name | :colon, bot]
244
244
 
245
245
  attr_reader name: TypeName
246
246
  attr_reader type: Types::t
@@ -258,7 +258,7 @@ module RBS
258
258
  # ^^^^^ name
259
259
  # ^ colon
260
260
  #
261
- type loc = Location::WithChildren[:name | :colon, bot]
261
+ type loc = Location[:name | :colon, bot]
262
262
 
263
263
  attr_reader name: Symbol
264
264
  attr_reader type: Types::t
data/sig/definition.rbs CHANGED
@@ -90,7 +90,7 @@ module RBS
90
90
 
91
91
  def initialize: (type_name: TypeName, params: Array[Symbol], ancestors: Array[Ancestor::t]) -> void
92
92
 
93
- def apply: (Array[Types::t], location: Location?) -> Array[Ancestor::t]
93
+ def apply: (Array[Types::t], location: Location[untyped, untyped]?) -> Array[Ancestor::t]
94
94
  end
95
95
 
96
96
  class SingletonAncestors
@@ -14,7 +14,7 @@ module RBS
14
14
 
15
15
  def validate_super_class!: (TypeName, Environment::ClassEntry) -> void
16
16
 
17
- def ensure_namespace!: (Namespace, location: Location?) -> void
17
+ def ensure_namespace!: (Namespace, location: Location[untyped, untyped]?) -> void
18
18
 
19
19
  def build_interface: (TypeName) -> Definition
20
20
 
@@ -37,7 +37,7 @@ module RBS
37
37
 
38
38
  def validate_type_params: (Definition, ancestors: AncestorBuilder::OneAncestors, methods: MethodBuilder::Methods) -> void
39
39
 
40
- def source_location: (Definition::Ancestor::Instance::source, AST::Declarations::t) -> Location?
40
+ def source_location: (Definition::Ancestor::Instance::source, AST::Declarations::t) -> Location[untyped, untyped]?
41
41
 
42
42
  def insert_variable: (TypeName, Hash[Symbol, Definition::Variable], name: Symbol, type: Types::t) -> void
43
43
 
data/sig/errors.rbs CHANGED
@@ -19,6 +19,11 @@ module RBS
19
19
  # Error class for errors raised during parsing.
20
20
  #
21
21
  class ParsingError < BaseError
22
+ attr_reader location: Location[untyped, untyped]
23
+ attr_reader error_message: String
24
+ attr_reader token_type: String
25
+
26
+ def initialize: (Location[untyped, untyped], String error_message, String token_type) -> void
22
27
  end
23
28
 
24
29
  # Error class for errors raised during loading environments.
@@ -35,45 +40,45 @@ module RBS
35
40
  attr_reader type_name: TypeName
36
41
  attr_reader args: Array[Types::t]
37
42
  attr_reader params: Array[Symbol]
38
- attr_reader location: Location?
43
+ attr_reader location: Location[untyped, untyped]?
39
44
 
40
- def initialize: (type_name: TypeName, args: Array[Types::t], params: Array[Symbol], location: Location?) -> void
45
+ def initialize: (type_name: TypeName, args: Array[Types::t], params: Array[Symbol], location: Location[untyped, untyped]?) -> void
41
46
 
42
- def self.check!: (type_name: TypeName, args: Array[Types::t], params: Array[Symbol], location: Location?) -> void
47
+ def self.check!: (type_name: TypeName, args: Array[Types::t], params: Array[Symbol], location: Location[untyped, untyped]?) -> void
43
48
  end
44
49
 
45
50
  class RecursiveAncestorError < DefinitionError
46
51
  attr_reader ancestors: Array[Definition::Ancestor::t]
47
- attr_reader location: Location?
52
+ attr_reader location: Location[untyped, untyped]?
48
53
 
49
- def initialize: (ancestors: Array[Definition::Ancestor::t], location: Location?) -> void
54
+ def initialize: (ancestors: Array[Definition::Ancestor::t], location: Location[untyped, untyped]?) -> void
50
55
 
51
- def self.check!: (Definition::Ancestor::t, ancestors: Array[Definition::Ancestor::t], location: Location?) -> void
56
+ def self.check!: (Definition::Ancestor::t, ancestors: Array[Definition::Ancestor::t], location: Location[untyped, untyped]?) -> void
52
57
  end
53
58
 
54
59
  class NoTypeFoundError < DefinitionError
55
60
  attr_reader type_name: TypeName
56
- attr_reader location: Location?
61
+ attr_reader location: Location[untyped, untyped]?
57
62
 
58
- def initialize: (type_name: TypeName, location: Location?) -> void
63
+ def initialize: (type_name: TypeName, location: Location[untyped, untyped]?) -> void
59
64
 
60
- def self.check!: (TypeName, env: Environment, location: Location?) -> TypeName
65
+ def self.check!: (TypeName, env: Environment, location: Location[untyped, untyped]?) -> TypeName
61
66
  end
62
67
 
63
68
  class NoSuperclassFoundError < DefinitionError
64
69
  attr_reader type_name: TypeName
65
- attr_reader location: Location?
70
+ attr_reader location: Location[untyped, untyped]?
66
71
 
67
- def initialize: (type_name: TypeName, location: Location?) -> void
72
+ def initialize: (type_name: TypeName, location: Location[untyped, untyped]?) -> void
68
73
 
69
- def self.check!: (TypeName, env: Environment, location: Location?) -> void
74
+ def self.check!: (TypeName, env: Environment, location: Location[untyped, untyped]?) -> void
70
75
  end
71
76
 
72
77
  class NoSelfTypeFoundError < DefinitionError
73
78
  attr_reader type_name: TypeName
74
- attr_reader location: Location?
79
+ attr_reader location: Location[untyped, untyped]?
75
80
 
76
- def initialize: (type_name: TypeName, location: Location?) -> void
81
+ def initialize: (type_name: TypeName, location: Location[untyped, untyped]?) -> void
77
82
 
78
83
  def self.check!: (AST::Declarations::Module::Self, env: Environment) -> void
79
84
  end
@@ -84,7 +89,7 @@ module RBS
84
89
 
85
90
  def initialize: (type_name: TypeName, member: AST::Members::t) -> void
86
91
 
87
- def location: () -> Location?
92
+ def location: () -> Location[untyped, untyped]?
88
93
 
89
94
  def self.check!: (TypeName, env: Environment, member: AST::Members::t) -> void
90
95
  end
@@ -103,9 +108,9 @@ module RBS
103
108
 
104
109
  def qualified_method_name: () -> String
105
110
 
106
- def location: () -> Location?
111
+ def location: () -> Location[untyped, untyped]?
107
112
 
108
- def other_locations: () -> Array[Location?]
113
+ def other_locations: () -> Array[Location[untyped, untyped]?]
109
114
  end
110
115
 
111
116
  class DuplicatedInterfaceMethodDefinitionError < DefinitionError
@@ -127,9 +132,9 @@ module RBS
127
132
  attr_reader type_name: TypeName
128
133
  attr_reader original_name: Symbol
129
134
  attr_reader aliased_name: Symbol
130
- attr_reader location: Location?
135
+ attr_reader location: Location[untyped, untyped]?
131
136
 
132
- def initialize: (type_name: TypeName, original_name: Symbol, aliased_name: Symbol, location: Location?) -> void
137
+ def initialize: (type_name: TypeName, original_name: Symbol, aliased_name: Symbol, location: Location[untyped, untyped]?) -> void
133
138
  end
134
139
 
135
140
  class SuperclassMismatchError < DefinitionError
@@ -165,9 +170,9 @@ module RBS
165
170
  class InvalidVarianceAnnotationError < DefinitionError
166
171
  attr_reader type_name: TypeName
167
172
  attr_reader param: AST::Declarations::ModuleTypeParams::TypeParam
168
- attr_reader location: Location?
173
+ attr_reader location: Location[untyped, untyped]?
169
174
 
170
- def initialize: (type_name: TypeName, param: AST::Declarations::ModuleTypeParams::TypeParam, location: Location?) -> void
175
+ def initialize: (type_name: TypeName, param: AST::Declarations::ModuleTypeParams::TypeParam, location: Location[untyped, untyped]?) -> void
171
176
  end
172
177
 
173
178
  class RecursiveAliasDefinitionError < DefinitionError
@@ -179,7 +184,7 @@ module RBS
179
184
 
180
185
  def initialize: (type: ty, defs: Array[defn]) -> void
181
186
 
182
- def location: () -> Location?
187
+ def location: () -> Location[untyped, untyped]?
183
188
  end
184
189
 
185
190
  class MixinClassError < DefinitionError
@@ -190,7 +195,7 @@ module RBS
190
195
 
191
196
  def initialize: (type_name: TypeName, member: member) -> void
192
197
 
193
- def location: () -> Location?
198
+ def location: () -> Location[untyped, untyped]?
194
199
 
195
200
  def self.check!: (type_name: TypeName, env: Environment, member: member) -> void
196
201
 
@@ -199,9 +204,9 @@ module RBS
199
204
 
200
205
  class RecursiveTypeAliasError < LoadingError
201
206
  attr_reader alias_names: Array[TypeName]
202
- attr_reader location: Location
207
+ attr_reader location: Location[untyped, untyped]?
203
208
 
204
- def initialize: (alias_names: Array[TypeName], location: Location) -> void
209
+ def initialize: (alias_names: Array[TypeName], location: Location[untyped, untyped]?) -> void
205
210
 
206
211
  def name: () -> String
207
212
  end