Class: BELParser::Language::Semantics::SemanticsTypeWarning
- Inherits:
-
SemanticsWarning
- Object
- SemanticsResult
- SemanticsWarning
- BELParser::Language::Semantics::SemanticsTypeWarning
- Defined in:
- lib/bel_parser/language/semantics_ast_warnings.rb,
lib/bel_parser/language/semantics_type_warning.rb
Instance Attribute Summary collapse
-
#actual_type ⇒ Object
readonly
Returns the value of attribute actual_type.
-
#expected_type ⇒ Object
readonly
Returns the value of attribute expected_type.
Attributes inherited from SemanticsResult
#expression_node, #specification
Instance Method Summary collapse
-
#initialize(expression_node, expected_type, actual_type, spec) ⇒ SemanticsTypeWarning
constructor
A new instance of SemanticsTypeWarning.
- #to_s ⇒ Object
Methods inherited from SemanticsWarning
Methods inherited from SemanticsResult
Constructor Details
#initialize(expression_node, expected_type, actual_type, spec) ⇒ SemanticsTypeWarning
Returns a new instance of SemanticsTypeWarning.
36 37 38 39 40 |
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 36 def initialize(expression_node, spec, expected, actual) super(expression_node, spec) @expected_type = expected.ast_type @actual_type = actual.type end |
Instance Attribute Details
#actual_type ⇒ Object (readonly)
Returns the value of attribute actual_type.
34 35 36 |
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 34 def actual_type @actual_type end |
#expected_type ⇒ Object (readonly)
Returns the value of attribute expected_type.
34 35 36 |
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 34 def expected_type @expected_type end |
Instance Method Details
#to_s ⇒ Object
42 43 44 |
# File 'lib/bel_parser/language/semantics_ast_warnings.rb', line 42 def to_s %(Expected #{expected_type} type, but saw #{actual_type} type.) end |