Exception: RBS::InheritModuleError
- Inherits:
-
DefinitionError
- Object
- StandardError
- BaseError
- DefinitionError
- RBS::InheritModuleError
- Includes:
- DetailedMessageable
- Defined in:
- lib/rbs/errors.rb
Instance Attribute Summary collapse
-
#super_decl ⇒ Object
readonly
Returns the value of attribute super_decl.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(super_decl) ⇒ InheritModuleError
constructor
A new instance of InheritModuleError.
- #location ⇒ Object
Methods included from DetailedMessageable
Constructor Details
#initialize(super_decl) ⇒ InheritModuleError
Returns a new instance of InheritModuleError.
192 193 194 195 196 |
# File 'lib/rbs/errors.rb', line 192 def initialize(super_decl) @super_decl = super_decl super "#{Location.to_string(super_decl.location)}: Cannot inherit a module: #{super_decl.name}" end |
Instance Attribute Details
#super_decl ⇒ Object (readonly)
Returns the value of attribute super_decl.
190 191 192 |
# File 'lib/rbs/errors.rb', line 190 def super_decl @super_decl end |
Class Method Details
.check!(super_decl, env:) ⇒ Object
202 203 204 205 206 207 |
# File 'lib/rbs/errors.rb', line 202 def self.check!(super_decl, env:) super_name = env.normalize_type_name(super_decl.name) return if env.class_decl?(super_name) || env.class_alias?(super_name) raise new(super_decl) end |
Instance Method Details
#location ⇒ Object
198 199 200 |
# File 'lib/rbs/errors.rb', line 198 def location @super_decl.location end |