diff --git a/src/las.c b/src/las.c
index 6e01e9ef214f020f7bffd2909022dbd770de97b0..40e3ba53d4e43f412674eb30e5e39755cf07f6d7 100644
--- a/src/las.c
+++ b/src/las.c
@@ -1346,8 +1346,8 @@ node *debug_mksoftcastnode(struct pike_type *type, node *n)
 	ref_push_type_value(n->type);
 	ref_push_type_value(type);
 	yytype_report(REPORT_ERROR,
-		      NULL, 0, NULL,
-		      NULL, 0, NULL,
+		      NULL, 0, type,
+		      NULL, 0, n->type,
 		      2, "Soft cast of %O to %O isn't a valid cast.");
       } else if (result_type == n->type) {
 	ref_push_type_value(n->type);