Class: Dhall::TypeChecker::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/dhall/typecheck.rb

Instance Method Summary collapse

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

Raises:

  • (TypeError)


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