Class: Dhall::TypeChecker::AnonymousType

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

Direct Known Subclasses

UnionType

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ AnonymousType

Returns a new instance of AnonymousType.



505
506
507
# File 'lib/dhall/typecheck.rb', line 505

def initialize(type)
	@type = type
end

Instance Method Details

#annotate(context) ⇒ Object



509
510
511
512
513
# File 'lib/dhall/typecheck.rb', line 509

def annotate(context)
	kinds = check(context)
	type = kinds.max_by { |k| KINDS.index(k) } || KINDS.first
	Dhall::TypeAnnotation.new(value: @type, type: type)
end