Class: Dhall::TypeChecker::Literal
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::Literal
- Defined in:
- lib/dhall/typecheck.rb
Instance Method Summary collapse
- #annotate ⇒ Object
-
#initialize(lit) ⇒ Literal
constructor
A new instance of Literal.
Constructor Details
#initialize(lit) ⇒ Literal
Returns a new instance of Literal.
104 105 106 107 108 |
# File 'lib/dhall/typecheck.rb', line 104 def initialize(lit) @lit = lit @type = Dhall::Variable[lit.class.name.split(/::/).last] @type = Builtins[@type.name.to_sym] || @type end |
Instance Method Details
#annotate ⇒ Object
110 111 112 113 114 115 |
# File 'lib/dhall/typecheck.rb', line 110 def annotate(*) Dhall::TypeAnnotation.new( value: @lit, type: @type ) end |