class Dhall::TypeChecker::TextLiteral

Public Class Methods

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

Public Instance Methods

annotate(context) click to toggle source
# File lib/dhall/typecheck.rb, line 151
def annotate(context)
        chunks = Chunks.new(@lit.chunks).map { |c|
                TypeChecker.for(c).annotate(context).tap do |annotated|
                        TypeChecker.assert annotated.type, Builtins[:Text],
                                           "Cannot interpolate #{annotated.type}"
                end
        }.to_a

        Dhall::TypeAnnotation.new(
                value: @lit.with(chunks: chunks),
                type:  Builtins[:Text]
        )
end