Class: Steep::Diagnostic::Signature::InvalidTypeApplication
- Defined in:
- lib/steep/diagnostic/signature.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes inherited from Base
Instance Method Summary collapse
- #header_line ⇒ Object
-
#initialize(name:, args:, params:, location:) ⇒ InvalidTypeApplication
constructor
A new instance of InvalidTypeApplication.
Methods inherited from Base
#detail_lines, #diagnostic_code, #path
Methods included from Helper
Constructor Details
#initialize(name:, args:, params:, location:) ⇒ InvalidTypeApplication
Returns a new instance of InvalidTypeApplication.
85 86 87 88 89 90 |
# File 'lib/steep/diagnostic/signature.rb', line 85 def initialize(name:, args:, params:, location:) super(location: location) @name = name @args = args @params = params end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
82 83 84 |
# File 'lib/steep/diagnostic/signature.rb', line 82 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
81 82 83 |
# File 'lib/steep/diagnostic/signature.rb', line 81 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
83 84 85 |
# File 'lib/steep/diagnostic/signature.rb', line 83 def params @params end |
Instance Method Details
#header_line ⇒ Object
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/steep/diagnostic/signature.rb', line 92 def header_line case when params.empty? "Type `#{name}` is not generic but used as a generic type with #{args.size} arguments" when args.empty? "Type `#{name}` is generic but used as a non generic type" else "Type `#{name}` expects #{params.size} arguments, but #{args.size} arguments are given" end end |