Class: Jade::Frontend::SemanticAnalysis::Error::PredicateMustReturnBool

Inherits:
Error
  • Object
show all
Defined in:
lib/jade/frontend/semantic_analysis/error/predicate_must_return_bool.rb

Instance Attribute Summary

Attributes inherited from Error

#entry, #span

Instance Method Summary collapse

Methods inherited from Error

#candidates, #notes, #queried_name, #to_diagnostic

Constructor Details

#initialize(entry, span, fn_name:) ⇒ PredicateMustReturnBool

Returns a new instance of PredicateMustReturnBool.



6
7
8
9
# File 'lib/jade/frontend/semantic_analysis/error/predicate_must_return_bool.rb', line 6

def initialize(entry, span, fn_name:)
  super(entry:, span:)
  @fn_name = fn_name
end

Instance Method Details

#labelObject



15
16
17
# File 'lib/jade/frontend/semantic_analysis/error/predicate_must_return_bool.rb', line 15

def label
  "expected `Bool` return"
end

#messageObject



11
12
13
# File 'lib/jade/frontend/semantic_analysis/error/predicate_must_return_bool.rb', line 11

def message
  "`#{@fn_name}` ends in `?` so it must return `Bool`."
end