diff --git a/compiler/ir1opt.lisp b/compiler/ir1opt.lisp
index fd7ba982fb782358105c943540c3fbdf95474d47..3dd36eb8b2b45acd77e8cca0e298149c7b66bbff 100644
--- a/compiler/ir1opt.lisp
+++ b/compiler/ir1opt.lisp
@@ -1054,8 +1054,8 @@
 				 (values-subtypep
 				  (node-derived-type use)
 				  (continuation-asserted-type arg)))
-			(substitute-leaf leaf var)
 			(propagate-to-refs var (continuation-type arg))
+			(substitute-leaf leaf var)
 			t)))))
 	       ((and (null (rest (leaf-refs var)))
 		     (substitute-single-use-continuation arg var)))