Exception: Rubycc::Front::ConstantEvaluator::OffsetofError
- Inherits:
-
NotConstant
- Object
- StandardError
- NotConstant
- Rubycc::Front::ConstantEvaluator::OffsetofError
- Defined in:
- lib/rubycc/front/constant_evaluator.rb
Overview
Raised when a __builtin_offsetof designator cannot name a byte offset:
its type is not a struct/union or is incomplete, a step names no such
member, a subscript step applies to a non-array member, or the target is
a bit-field (which has no addressable byte offset). It is a NotConstant
so every context that already reports a non-constant expression catches
it too; detail carries the specific wording for a caller (the
generator) that can surface it, over NotConstant's generic message.
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
Attributes inherited from NotConstant
Instance Method Summary collapse
-
#initialize(token, detail) ⇒ OffsetofError
constructor
A new instance of OffsetofError.
Constructor Details
#initialize(token, detail) ⇒ OffsetofError
Returns a new instance of OffsetofError.
64 65 66 67 |
# File 'lib/rubycc/front/constant_evaluator.rb', line 64 def initialize(token, detail) @detail = detail super(token) end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
62 63 64 |
# File 'lib/rubycc/front/constant_evaluator.rb', line 62 def detail @detail end |