Exception: RBS::MixinClassError
- Inherits:
-
DefinitionError
- Object
- StandardError
- BaseError
- DefinitionError
- RBS::MixinClassError
- 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
Constructor Details
#initialize(type_name:, member:) ⇒ MixinClassError
Returns a new instance of MixinClassError.
407 408 409 410 411 412 |
# File 'lib/rbs/errors.rb', line 407 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.
405 406 407 |
# File 'lib/rbs/errors.rb', line 405 def member @member end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
404 405 406 |
# File 'lib/rbs/errors.rb', line 404 def type_name @type_name end |
Class Method Details
.check!(type_name:, env:, member:) ⇒ Object
418 419 420 421 422 423 |
# File 'lib/rbs/errors.rb', line 418 def self.check!(type_name:, env:, member:) case env.class_decls[member.name] when Environment::ClassEntry raise new(type_name: type_name, member: member) end end |
Instance Method Details
#location ⇒ Object
414 415 416 |
# File 'lib/rbs/errors.rb', line 414 def location member.location end |