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.



483
484
485
486
487
# File 'lib/steep/diagnostic/signature.rb', line 483

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.



479
480
481
# File 'lib/steep/diagnostic/signature.rb', line 479

def param_name
  @param_name
end

#resultObject (readonly)

Returns the value of attribute result.



479
480
481
# File 'lib/steep/diagnostic/signature.rb', line 479

def result
  @result
end

Instance Method Details

#header_lineObject



493
494
495
# File 'lib/steep/diagnostic/signature.rb', line 493

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

#relationObject



489
490
491
# File 'lib/steep/diagnostic/signature.rb', line 489

def relation
  result.relation
end