Class: Jade::Frontend::SemanticAnalysis::Error::ConstructorPatternArityMismatch
- Inherits:
-
Error
- Object
- Error
- Jade::Frontend::SemanticAnalysis::Error::ConstructorPatternArityMismatch
- Defined in:
- lib/jade/frontend/semantic_analysis/error/constructor_pattern_arity_mismatch.rb
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(entry, span, constructor:, expected_arity:, actual_arity:) ⇒ ConstructorPatternArityMismatch
constructor
A new instance of ConstructorPatternArityMismatch.
- #label ⇒ Object
- #message ⇒ Object
Methods inherited from Error
#candidates, #notes, #queried_name, #to_diagnostic
Constructor Details
#initialize(entry, span, constructor:, expected_arity:, actual_arity:) ⇒ ConstructorPatternArityMismatch
Returns a new instance of ConstructorPatternArityMismatch.
6 7 8 9 10 11 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_pattern_arity_mismatch.rb', line 6 def initialize(entry, span, constructor:, expected_arity:, actual_arity:) super(entry:, span:) @constructor = constructor @expected_arity = expected_arity @actual_arity = actual_arity end |
Instance Method Details
#label ⇒ Object
17 18 19 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_pattern_arity_mismatch.rb', line 17 def label "expected #{@expected_arity} pattern#{@expected_arity > 1 ? 's' : ''}, got #{@actual_arity}" end |
#message ⇒ Object
13 14 15 |
# File 'lib/jade/frontend/semantic_analysis/error/constructor_pattern_arity_mismatch.rb', line 13 def "Arity mismatch, #{@constructor} expects #{@expected_arity} patterns but found #{@actual_arity}" end |