Class: Steep::Diagnostic::Signature::ModuleSelfTypeError

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(name:, ancestor:, result:, location:) ⇒ ModuleSelfTypeError

Returns a new instance of ModuleSelfTypeError.



259
260
261
262
263
264
265
# File 'lib/steep/diagnostic/signature.rb', line 259

def initialize(name:, ancestor:, result:, location:)
  super(location: location)

  @name = name
  @ancestor = ancestor
  @result = result
end

Instance Attribute Details

#ancestorObject (readonly)

Returns the value of attribute ancestor.



254
255
256
# File 'lib/steep/diagnostic/signature.rb', line 254

def ancestor
  @ancestor
end

#nameObject (readonly)

Returns the value of attribute name.



253
254
255
# File 'lib/steep/diagnostic/signature.rb', line 253

def name
  @name
end

#resultObject (readonly)

Returns the value of attribute result.



255
256
257
# File 'lib/steep/diagnostic/signature.rb', line 255

def result
  @result
end

Instance Method Details

#header_lineObject



271
272
273
# File 'lib/steep/diagnostic/signature.rb', line 271

def header_line
  "Module self type constraint in type `#{name}` doesn't satisfy: `#{relation}`"
end

#relationObject



267
268
269
# File 'lib/steep/diagnostic/signature.rb', line 267

def relation
  result.relation
end