Exception: RBS::InvalidVarianceAnnotationError

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:, param:, location:) ⇒ InvalidVarianceAnnotationError

Returns a new instance of InvalidVarianceAnnotationError.



406
407
408
409
410
411
412
# File 'lib/rbs/errors.rb', line 406

def initialize(type_name:, param:, location:)
  @type_name = type_name
  @param = param
  @location = location

  super "#{Location.to_string location}: Type parameter variance error: #{param.name} is #{param.variance} but used as incompatible variance"
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



404
405
406
# File 'lib/rbs/errors.rb', line 404

def location
  @location
end

#paramObject (readonly)

Returns the value of attribute param.



403
404
405
# File 'lib/rbs/errors.rb', line 403

def param
  @param
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



402
403
404
# File 'lib/rbs/errors.rb', line 402

def type_name
  @type_name
end