From 0cf4d3845e75ac25e35c5e73eb2dfd58c5450af6 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 6 Apr 2019 11:09:23 +0200 Subject: Factor out shift/subst/shift dance --- dhall/src/typecheck.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'dhall/src/typecheck.rs') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 75e6e1d..145de63 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -268,10 +268,7 @@ where let tA2 = normalized_type_with(ctx, a.clone())?; if prop_equal(tA.as_ref(), tA2.as_ref()) { let vx0 = &V(x.clone(), 0); - let a2 = shift(1, vx0, a); - let tB2 = subst(vx0, &a2, &tB); - let tB3 = shift(-1, vx0, &tB2); - return Ok(tB3); + return Ok(subst_shift(vx0, &a, &tB)); } else { Err(mkerr(TypeMismatch(f.clone(), tA, a.clone(), tA2))) } -- cgit v1.2.3