Class: Steep::Diagnostic::Signature::InconsistentClassModuleAliasError
- Defined in:
- lib/steep/diagnostic/signature.rb
Instance Attribute Summary collapse
-
#decl ⇒ Object
readonly
Returns the value of attribute decl.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(decl:) ⇒ InconsistentClassModuleAliasError
constructor
A new instance of InconsistentClassModuleAliasError.
Methods inherited from Base
#detail_lines, #diagnostic_code, #path
Methods included from Helper
Constructor Details
#initialize(decl:) ⇒ InconsistentClassModuleAliasError
Returns a new instance of InconsistentClassModuleAliasError.
397 398 399 400 |
# File 'lib/steep/diagnostic/signature.rb', line 397 def initialize(decl:) @decl = decl super(location: decl.location&.[](:old_name)) end |
Instance Attribute Details
#decl ⇒ Object (readonly)
Returns the value of attribute decl.
395 396 397 |
# File 'lib/steep/diagnostic/signature.rb', line 395 def decl @decl end |
Instance Method Details
#header_line ⇒ Object
402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/steep/diagnostic/signature.rb', line 402 def header_line expected_kind = case decl when RBS::AST::Declarations::ModuleAlias "module" when RBS::AST::Declarations::ClassAlias "class" else raise end "A #{expected_kind} `#{decl.new_name}` cannot be an alias of `#{decl.old_name}`" end |