Class: Jade::Frontend::SemanticAnalysis::Error::NestedTaskPort

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

Instance Attribute Summary

Attributes inherited from Error

#entry, #span

Instance Method Summary collapse

Methods inherited from Error

#candidates, #label, #notes, #queried_name, #to_diagnostic

Constructor Details

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

Returns a new instance of NestedTaskPort.



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

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

Instance Method Details

#messageObject



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

def message
  "Port `#{@fn_name}` declares a Task whose Ok or Err arm is itself a Task; " \
    "tasks must not return tasks — compose with map/and_then/sequence in Jade instead"
end