Class: Dhall::TypeChecker::UnionType

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

Instance Method Summary collapse

Methods inherited from AnonymousType

#initialize

Constructor Details

This class inherits a constructor from Dhall::TypeChecker::AnonymousType

Instance Method Details

#annotate(context) ⇒ Object



532
533
534
535
536
537
538
539
540
# File 'lib/dhall/typecheck.rb', line 532

def annotate(context)
	kinds = check(context)

	TypeChecker.assert kinds, Util::ArrayAllTheSame,
	                   "AnonymousType field kinds not all the same"

	type = kinds.first || KINDS.first
	Dhall::TypeAnnotation.new(value: @type, type: type)
end