Class: Dhall::TypeChecker::OptionalNone
- Inherits:
-
Object
- Object
- Dhall::TypeChecker::OptionalNone
- Defined in:
- lib/dhall/typecheck.rb
Instance Method Summary collapse
- #annotate(context) ⇒ Object
-
#initialize(expr) ⇒ OptionalNone
constructor
A new instance of OptionalNone.
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 |