Class: Rigor::Inference::VoidOrigin
- Inherits:
-
Data
- Object
- Data
- Rigor::Inference::VoidOrigin
- Defined in:
- lib/rigor/inference/void_origin.rb
Overview
ADR-100 WD3 — the resolved -> void origin site recorded in Scope#void_origins. A small cause
record, never a carrier field: it says which author-declared -> void return was recovered to top
at a use site, so the static.value-use.void diagnostic can name it. Mirrors the provenance-as-
side-channel discipline DynamicOrigin established (ADR-75) — it never participates in subtyping,
consistency, normalization, or erasure.
Instance Attribute Summary collapse
-
#class_name ⇒ String
The receiver class whose method declared
-> void. -
#kind ⇒ Symbol
:instanceor:singleton. -
#method_name ⇒ Symbol
The method whose return was recovered.
Instance Method Summary collapse
-
#label ⇒ Object
A human-facing
Class#method/Class.methodlabel for the diagnostic message.
Instance Attribute Details
#class_name ⇒ String
Returns the receiver class whose method declared -> void.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
#kind ⇒ Symbol
Returns :instance or :singleton.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
#method_name ⇒ Symbol
Returns the method whose return was recovered.
17 18 19 20 21 22 23 |
# File 'lib/rigor/inference/void_origin.rb', line 17 VoidOrigin = Data.define(:class_name, :method_name, :kind) do # A human-facing `Class#method` / `Class.method` label for the diagnostic message. def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end end |
Instance Method Details
#label ⇒ Object
A human-facing Class#method / Class.method label for the diagnostic message.
19 20 21 22 |
# File 'lib/rigor/inference/void_origin.rb', line 19 def label separator = kind == :singleton ? "." : "#" "#{class_name}#{separator}#{method_name}" end |