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.



87
88
89
# File 'lib/dhall/typecheck.rb', line 87

def initialize(var)
	@var = var
end

Instance Method Details

#annotate(context) ⇒ Object

Raises:

  • (TypeError)


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