diff --git a/compiler2/Type_codegen.cc b/compiler2/Type_codegen.cc
index 9f4e9659f3fec0b6336f30fb55c9e125d891cb7e..83591376ce1266784354f25797d4ee5b1e92c28b 100644
--- a/compiler2/Type_codegen.cc
+++ b/compiler2/Type_codegen.cc
@@ -1247,6 +1247,13 @@ void Type::generate_code_alias(output_struct *target)
       "typedef %s_template %s_template;\n",
       refd_name, own_name);
     break;
+  case T_CLASS: {
+    Ttcn::ClassTypeBody* class_ = t_last->get_class_type_body();
+    target->header.typedefs = mputprintf(target->header.typedefs,
+      "typedef %s %s;\n",
+      class_->is_built_in() ? "OBJECT" : t_last->get_genname_own(my_scope).c_str(),
+      own_name);
+    break; }
   default: // value and template classes exist
     target->header.typedefs = mputprintf(target->header.typedefs,
 #ifndef NDEBUG