Class: Dhall::TypeChecker::OptionalNone

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

Instance Method Summary collapse

Constructor Details

#initialize(expr) ⇒ OptionalNone

Returns a new instance of OptionalNone.



451
452
453
# File 'lib/dhall/typecheck.rb', line 451

def initialize(expr)
	@expr = expr
end

Instance Method Details

#annotate(context) ⇒ Object



455
456
457
458
459
460
461
462
463
# File 'lib/dhall/typecheck.rb', line 455

def annotate(context)
	TypeChecker.assert(
		TypeChecker.for(@expr.value_type).annotate(context).type,
		Builtins[:Type],
		"OptionalNone element type not of type Type"
	)

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