class RBS::InheritModuleError
InheritModuleError is raised if a class definition inherits a module (not a class)
Attributes
super_decl
[R]
super_class
Public Class Methods
(super_class, env: Environment) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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
Confirms if super inherits specifies a class
Automatically normalize the name of super.
(super_class) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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
Calls superclass method
Exception::new
Public Instance Methods
() → Location[untyped, untyped]?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 198 def location @super_decl.location end