Class: Jade::Frontend::SemanticAnalysis::Error::DuplicateImplementation
- Inherits:
-
Error
- Object
- Error
- Jade::Frontend::SemanticAnalysis::Error::DuplicateImplementation
show all
- Defined in:
- lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb
Instance Attribute Summary
Attributes inherited from Error
#entry, #span
Instance Method Summary
collapse
Methods inherited from Error
#candidates, #queried_name, #to_diagnostic
Constructor Details
#initialize(entry, span, interface:, type:, first_span:, parameterized:) ⇒ DuplicateImplementation
Returns a new instance of DuplicateImplementation.
6
7
8
9
10
11
12
|
# File 'lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb', line 6
def initialize(entry, span, interface:, type:, first_span:, parameterized:)
@interface = interface
@type = type
@first_span = first_span
@parameterized = parameterized
super(entry:, span:)
end
|
Instance Method Details
#label ⇒ Object
18
19
20
|
# File 'lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb', line 18
def label
"already implemented"
end
|
#message ⇒ Object
14
15
16
|
# File 'lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb', line 14
def message
"Duplicate implementation of #{@interface} for #{@type}"
end
|
#notes ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb', line 26
def notes
return [] unless @parameterized
[Jade::Diagnostics::Annotation[
:note,
"an implementation is chosen by the head type `#{@type}` alone — " \
'its type arguments do not select between implementations',
]]
end
|
#secondary ⇒ Object
22
23
24
|
# File 'lib/jade/frontend/semantic_analysis/error/duplicate_implementation.rb', line 22
def secondary
[[@first_span, 'first implemented here']]
end
|