Exception: RBS::InvalidOverloadMethodError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type_name:, method_name:, kind:, members:) ⇒ InvalidOverloadMethodError

Returns a new instance of InvalidOverloadMethodError.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/rbs/errors.rb', line 263

def initialize(type_name:, method_name:, kind:, members:)
  @type_name = type_name
  @method_name = method_name
  @kind = kind
  @members = members

  delimiter = case kind
              when :instance
                "#"
              when :singleton
                "."
              end

  super "#{Location.to_string members[0].location}: Invalid method overloading: #{type_name}#{delimiter}#{method_name}"
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



260
261
262
# File 'lib/rbs/errors.rb', line 260

def kind
  @kind
end

#membersObject (readonly)

Returns the value of attribute members.



261
262
263
# File 'lib/rbs/errors.rb', line 261

def members
  @members
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



259
260
261
# File 'lib/rbs/errors.rb', line 259

def method_name
  @method_name
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



258
259
260
# File 'lib/rbs/errors.rb', line 258

def type_name
  @type_name
end