~singpolyma/dhall-ruby

d78e18359d0267e703bdba42428d947f3f7fbf7d — Stephen Paul Weber 3 years ago 1358c35
Do not deep-annotate OpenStruct#as_dhall
1 files changed, 6 insertions(+), 7 deletions(-)

M lib/dhall/as_dhall.rb
M lib/dhall/as_dhall.rb => lib/dhall/as_dhall.rb +6 -7
@@ 179,13 179,12 @@ module Dhall

		refine ::OpenStruct do
			def as_dhall
				annotation = TypeChecker
					            .for(to_h.as_dhall)
					            .annotate(TypeChecker::Context.new)
				Union.new(
					tag:          "OpenStruct",
					value:        annotation,
					alternatives: UnionType.new(alternatives: {})
				expr = to_h.as_dhall
				type = TypeChecker.for(expr).annotate(TypeChecker::Context.new).type
				Union.from(
					UnionType.new(alternatives: { "OpenStruct" => type }),
					"OpenStruct",
					expr
				)
			end
		end