Class: Jade::Frontend::SemanticAnalysis::Error::ConstantNotCallable

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

Instance Attribute Summary collapse

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, name:) ⇒ ConstantNotCallable

Returns a new instance of ConstantNotCallable.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#labelObject



17
18
19
# File 'lib/jade/frontend/semantic_analysis/error/constant_not_callable.rb', line 17

def label
  "not callable"
end

#messageObject



13
14
15
# File 'lib/jade/frontend/semantic_analysis/error/constant_not_callable.rb', line 13

def message
  "`#{name}` is a value, not a function — write `#{name}`, not `#{name}()`"
end