43890aec4916d92fd9f40b523d1024c824ebb7ac — Stephen Paul Weber 3 months ago 89a9f12
Typecheck while resolving
2 files changed, 3 insertions(+), 2 deletions(-)

M lib/dhall/resolve.rb
M test/test_resolve.rb
M lib/dhall/resolve.rb => lib/dhall/resolve.rb +1 -0
@@ 442,6 442,7 @@
 				Promise.resolve(nil).then do
 					resolver.cache_fetch(@expr.cache_key(relative_to)) do
 						resolve_raw(resolver: resolver, relative_to: relative_to)
+							.then(&TypeChecker.method(:annotate)).then(&:normalize)
 					end
 				end
 			end

M test/test_resolve.rb => test/test_resolve.rb +2 -2
@@ 203,11 203,11 @@
 			rhs: Dhall::Import.new(
 				Dhall::Import::NoIntegrityCheck.new,
 				Dhall::Import::Expression,
-				Dhall::Import::RelativePath.new("import")
+				Dhall::Import::RelativePath.new("moretext")
 			)
 		)
 
-		assert_equal Dhall::Variable["_"], subject(expr)
+		assert_equal Dhall::Text.new(value: "hai"), subject(expr)
 	end
 
 	def test_headers