Class: Dhall::TypeChecker::Merge

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

Defined Under Namespace

Classes: AnnotatedMerge, Handlers

Instance Method Summary collapse

Constructor Details

#initialize(merge) ⇒ Merge

Returns a new instance of Merge.



635
636
637
638
639
# File 'lib/dhall/typecheck.rb', line 635

def initialize(merge)
  @merge = merge
  @record = TypeChecker.for(merge.record)
  @union = TypeChecker.for(merge.input)
end

Instance Method Details

#annotate(context) ⇒ Object



727
728
729
730
731
732
733
734
735
# File 'lib/dhall/typecheck.rb', line 727

def annotate(context)
  amerge = AnnotatedMerge.new(
    merge:  @merge,
    record: @record.annotate(context),
    input:  @union.annotate(context)
  )
  amerge.assert_kind(context)
  amerge.annotation
end