Class: Rigor::Type::Dynamic
- Inherits:
-
Object
- Object
- Rigor::Type::Dynamic
- Includes:
- AcceptanceRouter, ValueSemantics
- Defined in:
- lib/rigor/type/dynamic.rb,
sig/rigor/type.rbs
Overview
The dynamic-origin wrapper: marks values whose type came from an unchecked source. Carries a static facet that records the analyzer's best static knowledge. See docs/type-specification/value-lattice.md for the algebra and docs/type-specification/special-types.md for the untyped/Dynamic relationship.
Construct via Rigor::Type::Combinator.dynamic(static_facet).
Instance Attribute Summary collapse
-
#static_facet ⇒ Type::t
readonly
Returns the value of attribute static_facet.
Instance Method Summary collapse
- #== ⇒ Boolean
- #accepts ⇒ AcceptsResult
- #bot ⇒ Trinary
- #describe(verbosity = :short) ⇒ String
- #dynamic ⇒ Trinary
- #erase_to_rbs ⇒ "untyped"
- #hash ⇒ Integer
-
#initialize(static_facet) ⇒ Dynamic
constructor
A new instance of Dynamic.
- #inspect ⇒ String
- #top ⇒ Trinary
Methods included from ValueSemantics
Constructor Details
#initialize(static_facet) ⇒ Dynamic
Returns a new instance of Dynamic.
17 18 19 20 |
# File 'lib/rigor/type/dynamic.rb', line 17 def initialize(static_facet) @static_facet = static_facet freeze end |
Instance Attribute Details
#static_facet ⇒ Type::t (readonly)
Returns the value of attribute static_facet.
15 16 17 |
# File 'lib/rigor/type/dynamic.rb', line 15 def static_facet @static_facet end |
Instance Method Details
#== ⇒ Boolean
65 |
# File 'sig/rigor/type.rbs', line 65
def ==: (untyped other) -> bool
|
#accepts ⇒ AcceptsResult
64 |
# File 'sig/rigor/type.rbs', line 64
def accepts: (Type::t other, ?mode: accepts_mode) -> AcceptsResult
|
#describe(verbosity = :short) ⇒ String
22 23 24 |
# File 'lib/rigor/type/dynamic.rb', line 22 def describe(verbosity = :short) "Dynamic[#{static_facet.describe(verbosity)}]" end |
#erase_to_rbs ⇒ "untyped"
26 27 28 |
# File 'lib/rigor/type/dynamic.rb', line 26 def erase_to_rbs "untyped" end |
#hash ⇒ Integer
66 |
# File 'sig/rigor/type.rbs', line 66
def hash: () -> Integer
|
#inspect ⇒ String
48 49 50 |
# File 'lib/rigor/type/dynamic.rb', line 48 def inspect "#<Rigor::Type::Dynamic #{describe(:short)}>" end |