123456789_123456789_123456789_123456789_123456789_

Exception: RBS::InvalidTypeApplicationError

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, DefinitionError, BaseError, StandardError
Instance Chain:
self, DefinitionError, BaseError, StandardError
Inherits: RBS::DefinitionError
Defined in: lib/rbs/errors.rb

Class Method Summary

Instance Attribute Summary

Constructor Details

.new(type_name:, args:, params:, location:) ⇒ InvalidTypeApplicationError

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 57

def initialize(type_name:, args:, params:, location:)
  @type_name = type_name
  @args = args
  @params = params
  @location = location
  super "#{Location.to_string location}: #{type_name} expects parameters [#{params.join(", ")}], but given args [#{args.join(", ")}]"
end

Class Method Details

.check!(type_name:, args:, params:, location:)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 65

def self.check!(type_name:, args:, params:, location:)
  unless args.size == params.size
    raise new(type_name: type_name, args: args, params: params, location: location)
  end
end

Instance Attribute Details

#args (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 53

attr_reader :args

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 55

attr_reader :location

#params (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 54

attr_reader :params

#type_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/errors.rb', line 52

attr_reader :type_name