Exception: RBS::InvalidOverloadMethodError

Inherits:
DefinitionError 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.



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/rbs/errors.rb', line 318

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.



315
316
317
# File 'lib/rbs/errors.rb', line 315

def kind
  @kind
end

#membersObject (readonly)

Returns the value of attribute members.



316
317
318
# File 'lib/rbs/errors.rb', line 316

def members
  @members
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



314
315
316
# File 'lib/rbs/errors.rb', line 314

def method_name
  @method_name
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



313
314
315
# File 'lib/rbs/errors.rb', line 313

def type_name
  @type_name
end