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.
89 90 91 |
# File 'lib/dhall/typecheck.rb', line 89 def initialize(var) @var = var end |
Instance Method Details
#annotate(context) ⇒ Object
93 94 95 96 97 98 99 100 |
# File 'lib/dhall/typecheck.rb', line 93 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 |