Class: Dhall::TypeChecker::RecordSelection

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

Defined Under Namespace

Classes: Selector, TypeSelector

Instance Method Summary collapse

Constructor Details

#initialize(selection) ⇒ RecordSelection

Returns a new instance of RecordSelection.



542
543
544
545
546
# File 'lib/dhall/typecheck.rb', line 542

def initialize(selection)
	@selection = selection
	@record = selection.record
	@selector = selection.selector
end

Instance Method Details

#annotate(context) ⇒ Object



580
581
582
583
584
585
586
587
588
# File 'lib/dhall/typecheck.rb', line 580

def annotate(context)
	arecord = TypeChecker.for(@record).annotate(context)
	selector = Selector.for(arecord)

	Dhall::TypeAnnotation.new(
		value: @selection.with(record: arecord),
		type:  selector.select(@selector)
	)
end