class Dhall::TypeChecker::TypeAnnotation

Public Class Methods

new(expr) click to toggle source
# File lib/dhall/typecheck.rb, line 1021
def initialize(expr)
        @expr = expr
end

Public Instance Methods

annotate(context) click to toggle source
# File lib/dhall/typecheck.rb, line 1025
def annotate(context)
        redo_annotation = TypeChecker.for(@expr.value).annotate(context)

        if redo_annotation.type.normalize == @expr.type.normalize
                redo_annotation
        else
                raise TypeError, "TypeAnnotation does not match: " \
                                 "#{@expr.type}, #{redo_annotation.type}"
        end
end