Class: Dhall::TypeChecker::Variable
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::Variable
- Defined in:
- lib/dhall/typecheck.rb
Instance Method Summary collapse
- #annotate(context) ⇒ Object
-
#initialize(var) ⇒ Variable
constructor
A new instance of Variable.
Constructor Details
#initialize(var) ⇒ Variable
Returns a new instance of Variable.
87 88 89 |
# File 'lib/dhall/typecheck.rb', line 87 def initialize(var) @var = var end |
Instance Method Details
#annotate(context) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/dhall/typecheck.rb', line 91 def annotate(context) raise TypeError, "Sort has no Type, Kind, or Sort" if @var.name == "Sort" Dhall::TypeAnnotation.new( value: @var, type: context.fetch(@var) ) end |