class Dhallish::Ast::RecordTypeRecursiveMergeNode
Attributes
lhs[RW]
rhs[RW]
Public Class Methods
new(lhs, rhs)
click to toggle source
# File lib/ast.rb, line 542 def initialize(lhs, rhs) @lhs = lhs @rhs = rhs end
Public Instance Methods
compute_type(ctx)
click to toggle source
# File lib/ast.rb, line 547 def compute_type(ctx) lhs = @lhs.compute_type ctx rhs = @rhs.compute_type ctx assert("`//\\\\` can only merge record types") { lhs.is_a? Types::Type and rhs.is_a? Types::Type and lhs.metadata.is_a? Types::Record and rhs.metadata.is_a? Types::Record } Types::Type.new(::Dhallish::mergeRecordTypes(lhs.metadata, rhs.metadata)) end
evaluate(ctx)
click to toggle source
# File lib/ast.rb, line 556 def evaluate(ctx) lhs = @lhs.evaluate(ctx) rhs = @rhs.evaluate(ctx) ::Dhallish::mergeRecordTypes(lhs, rhs) end