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



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

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

Instance Method Details

#annotate(context) ⇒ Object



620
621
622
623
624
625
626
627
628
# File 'lib/dhall/typecheck.rb', line 620

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