123456789_123456789_123456789_123456789_123456789_

Exception: RBS::InheritModuleError

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(super_decl) ⇒ InheritModuleError

[ GitHub ]

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

def initialize(super_decl)
  @super_decl = super_decl

  super "#{Location.to_string(super_decl.location)}: Cannot inherit a module: #{super_decl.name}"
end

Class Method Details

.check!(super_decl, env:)

[ GitHub ]

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

def self.check!(super_decl, env:)
  return if env.class_decls[super_decl.name].is_a?(Environment::ClassEntry)

  raise new(super_decl)
end

Instance Attribute Details

#super_decl (readonly)

[ GitHub ]

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

attr_reader :super_decl