Class: Dhall::TypeChecker::EmptyList

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

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ EmptyList

Returns a new instance of EmptyList.



360
361
362
# File 'lib/dhall/typecheck.rb', line 360

def initialize(expr)
  @expr = expr
end

Instance Method Details

#annotate(context) ⇒ Object



364
365
366
367
368
369
370
# File 'lib/dhall/typecheck.rb', line 364

def annotate(context)
  TypeChecker.assert_type @expr.element_type, Builtins[:Type],
                          "EmptyList element type not of type Type",
                          context: context

  Dhall::TypeAnnotation.new(type: @expr.type, value: @expr)
end