diff --git a/compiler2/ttcn3/TtcnTemplate.cc b/compiler2/ttcn3/TtcnTemplate.cc
index c8149ac0713fb1c9b8cd908f259b0108356096aa..05226c4d52884a1d8a3b4c5998c2b45d40092ff8 100644
--- a/compiler2/ttcn3/TtcnTemplate.cc
+++ b/compiler2/ttcn3/TtcnTemplate.cc
@@ -2692,8 +2692,8 @@ end:
               tpl->error("Matching mechanism can not be used as target of 'all from'");
               break;
             default:
-              tpl->error("A template of type '%s' can not be used as target of 'all from'",
-                type->get_typename().c_str());
+              tpl->error("'%s' can not be used as target of 'all from'",
+                tpl->get_templatetype_str());
               break;
             }
           }