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.



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

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

Instance Method Details

#annotate(context) ⇒ Object



569
570
571
572
573
574
575
576
577
# File 'lib/dhall/typecheck.rb', line 569

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