Exception: RBS::InvalidOverloadMethodError

Inherits:
DefinitionError show all
Includes:
DetailedMessageable
Defined in:
lib/rbs/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DetailedMessageable

#detailed_message

Constructor Details

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

Returns a new instance of InvalidOverloadMethodError.



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/rbs/errors.rb', line 362

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.



359
360
361
# File 'lib/rbs/errors.rb', line 359

def kind
  @kind
end

#membersObject (readonly)

Returns the value of attribute members.



360
361
362
# File 'lib/rbs/errors.rb', line 360

def members
  @members
end

#method_nameObject (readonly)

Returns the value of attribute method_name.



358
359
360
# File 'lib/rbs/errors.rb', line 358

def method_name
  @method_name
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



357
358
359
# File 'lib/rbs/errors.rb', line 357

def type_name
  @type_name
end

Instance Method Details

#locationObject



378
379
380
# File 'lib/rbs/errors.rb', line 378

def location
  members[0].location
end