Exception: RBS::MixinClassError
- Inherits:
-
DefinitionError
- Object
- StandardError
- BaseError
- DefinitionError
- RBS::MixinClassError
- Includes:
- DetailedMessageable
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#member ⇒ Object
readonly
Returns the value of attribute member.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type_name:, member:) ⇒ MixinClassError
constructor
A new instance of MixinClassError.
- #location ⇒ Object
Methods included from DetailedMessageable
Constructor Details
#initialize(type_name:, member:) ⇒ MixinClassError
Returns a new instance of MixinClassError.
434 435 436 437 438 439 |
# File 'lib/rbs/errors.rb', line 434 def initialize(type_name:, member:) @type_name = type_name @member = member super "#{Location.to_string member.location}: Cannot #{mixin_name} a class `#{member.name}` in the definition of `#{type_name}`" end |
Instance Attribute Details
#member ⇒ Object (readonly)
Returns the value of attribute member.
432 433 434 |
# File 'lib/rbs/errors.rb', line 432 def member @member end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
431 432 433 |
# File 'lib/rbs/errors.rb', line 431 def type_name @type_name end |
Class Method Details
.check!(type_name:, env:, member:) ⇒ Object
445 446 447 448 449 |
# File 'lib/rbs/errors.rb', line 445 def self.check!(type_name:, env:, member:) if env.class_decl?(member.name) raise new(type_name: type_name, member: member) end end |
Instance Method Details
#location ⇒ Object
441 442 443 |
# File 'lib/rbs/errors.rb', line 441 def location member.location end |