Exception: RBS::InvalidVarianceAnnotationError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type_name:, param:, location:) ⇒ InvalidVarianceAnnotationError

Returns a new instance of InvalidVarianceAnnotationError.



312
313
314
315
316
317
318
# File 'lib/rbs/errors.rb', line 312

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.



310
311
312
# File 'lib/rbs/errors.rb', line 310

def location
  @location
end

#paramObject (readonly)

Returns the value of attribute param.



309
310
311
# File 'lib/rbs/errors.rb', line 309

def param
  @param
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



308
309
310
# File 'lib/rbs/errors.rb', line 308

def type_name
  @type_name
end