Class: Steep::Diagnostic::Signature::UnsatisfiableGenericsDefaultType

Inherits:
Base
  • Object
show all
Includes:
ResultPrinter2
Defined in:
lib/steep/diagnostic/signature.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods included from ResultPrinter2

#detail_lines, #result_line

Methods inherited from Base

#detail_lines, #diagnostic_code, #path

Methods included from Helper

#error_name, #full_message

Constructor Details

#initialize(param_name, result, location:) ⇒ UnsatisfiableGenericsDefaultType

Returns a new instance of UnsatisfiableGenericsDefaultType.



448
449
450
451
452
# File 'lib/steep/diagnostic/signature.rb', line 448

def initialize(param_name, result, location:)
  super(location: location)
  @param_name = param_name
  @result = result
end

Instance Attribute Details

#param_nameObject (readonly)

Returns the value of attribute param_name.



444
445
446
# File 'lib/steep/diagnostic/signature.rb', line 444

def param_name
  @param_name
end

#resultObject (readonly)

Returns the value of attribute result.



444
445
446
# File 'lib/steep/diagnostic/signature.rb', line 444

def result
  @result
end

Instance Method Details

#header_lineObject



458
459
460
# File 'lib/steep/diagnostic/signature.rb', line 458

def header_line
  "The default type of `#{param_name}` doesn't satisfy upper bound constraint: #{relation}"
end

#relationObject



454
455
456
# File 'lib/steep/diagnostic/signature.rb', line 454

def relation
  result.relation
end