Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/Parser/DeclarationNode.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -57,4 +57,5 @@
 	variable.tyClass = NoTypeClass;
 	variable.assertions = nullptr;
+	variable.initializer = nullptr;
 
 //	attr.name = nullptr;
@@ -70,4 +71,5 @@
 //	delete variable.name;
 	delete variable.assertions;
+	delete variable.initializer;
 
 	delete type;
@@ -101,4 +103,5 @@
 	newnode->variable.tyClass = variable.tyClass;
 	newnode->variable.assertions = maybeClone( variable.assertions );
+	newnode->variable.initializer = maybeClone( variable.initializer );
 
 //	newnode->attr.name = attr.name ? new string( *attr.name ) : nullptr;
@@ -857,4 +860,10 @@
 }
 
+DeclarationNode * DeclarationNode::addTypeInitializer( DeclarationNode * init ) {
+	assertf( variable.tyClass != NoTypeClass, "Called addTypeInitializer on something that isn't a type variable." );
+	variable.initializer = init;
+	return this;
+}
+
 DeclarationNode * DeclarationNode::cloneType( string * newName ) {
 	DeclarationNode * newnode = new DeclarationNode;
@@ -1014,5 +1023,5 @@
 		assertf( sizeof(kindMap)/sizeof(kindMap[0] == NoTypeClass-1), "DeclarationNode::build: kindMap is out of sync." );
 		assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." );
-		TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ] );
+		TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.initializer ? variable.initializer->buildType() : nullptr );
 		buildList( variable.assertions, ret->get_assertions() );
 		return ret;
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/Parser/ParseNode.h	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -274,4 +274,5 @@
 	DeclarationNode * addIdList( DeclarationNode * list ); // old-style functions
 	DeclarationNode * addInitializer( InitializerNode * init );
+	DeclarationNode * addTypeInitializer( DeclarationNode * init );
 
 	DeclarationNode * cloneType( std::string * newName );
@@ -301,4 +302,5 @@
 		DeclarationNode::TypeClass tyClass;
 		DeclarationNode * assertions;
+		DeclarationNode * initializer;
 	};
 	Variable_t variable;
Index: src/Parser/parser.yy
===================================================================
--- src/Parser/parser.yy	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/Parser/parser.yy	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -1606,5 +1606,7 @@
 
 typegen_name:											// CFA
-	TYPEGENname '(' type_list ')'
+	TYPEGENname '(' ')'
+		{ $$ = DeclarationNode::newFromTypeGen( $1, nullptr ); }
+	| TYPEGENname '(' type_list ')'
 		{ $$ = DeclarationNode::newFromTypeGen( $1, $3 ); }
 	;
@@ -1983,6 +1985,7 @@
 
 type_parameter_list:									// CFA
-	type_parameter type_initializer_opt
-	| type_parameter_list ',' type_parameter type_initializer_opt
+	type_parameter
+		{ $$ = $1; }
+	| type_parameter_list ',' type_parameter
 		{ $$ = $1->appendList( $3 ); }
 	;
@@ -1998,6 +2001,6 @@
 	type_class no_attr_identifier_or_type_name
 		{ typedefTable.addToEnclosingScope( *$2, TypedefTable::TD ); }
-	  assertion_list_opt
-		{ $$ = DeclarationNode::newTypeParam( $1, $2 )->addAssertions( $4 ); }
+	  type_initializer_opt assertion_list_opt
+		{ $$ = DeclarationNode::newTypeParam( $1, $2 )->addTypeInitializer( $4 )->addAssertions( $5 ); }
 	| type_specifier identifier_parameter_declarator
 	;
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SymTab/Indexer.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -285,4 +285,5 @@
 		addType( typeDecl );
 		acceptAll( typeDecl->get_assertions(), *this );
+		acceptNewScope( typeDecl->get_init(), *this );
 	}
 
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SymTab/Validate.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -506,4 +506,5 @@
 	void LinkReferenceToTypes::visit( StructDecl *structDecl ) {
 		// visit struct members first so that the types of self-referencing members are updated properly
+		// xxx - need to ensure that type parameters match up between forward declarations and definition (most importantly, number of type parameters and and their defaults)
 		Parent::visit( structDecl );
 		if ( ! structDecl->get_members().empty() ) {
@@ -844,4 +845,29 @@
 		if ( params != NULL ) {
 			std::list< Expression * > & args = inst->get_parameters();
+
+			// insert defaults arguments when a type argument is missing (currently only supports missing arguments at the end of the list).
+			// A substitution is used to ensure that defaults are replaced correctly, e.g.,
+			//   forall(otype T, otype alloc = heap_allocator(T)) struct vector;
+			//   vector(int) v;
+			// after insertion of default values becomes
+			//   vector(int, heap_allocator(T))
+			// and the substitution is built with T=int so that after substitution, the result is
+			//   vector(int, heap_allocator(int))
+			TypeSubstitution sub;
+			auto paramIter = params->begin();
+			for ( size_t i = 0; paramIter != params->end(); ++paramIter, ++i ) {
+				if ( i < args.size() ) {
+					TypeExpr * expr = safe_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) );
+					sub.add( (*paramIter)->get_name(), expr->get_type()->clone() );
+				} else if ( i == args.size() ) {
+					Type * defaultType = (*paramIter)->get_init();
+					if ( defaultType ) {
+						args.push_back( new TypeExpr( defaultType->clone() ) );
+						sub.add( (*paramIter)->get_name(), defaultType->clone() );
+					}
+				}
+			}
+
+			sub.apply( inst );
 			if ( args.size() < params->size() ) throw SemanticError( "Too few type arguments in generic type ", inst );
 			if ( args.size() > params->size() ) throw SemanticError( "Too many type arguments in generic type ", inst );
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SynTree/Declaration.h	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -194,8 +194,12 @@
 	};
 
-	TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind );
+	TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init = nullptr );
 	TypeDecl( const TypeDecl &other );
+	virtual ~TypeDecl();
 
 	Kind get_kind() const { return kind; }
+
+	Type * get_init() const { return init; }
+	TypeDecl * set_init( Type * newValue ) { init = newValue; return this; }
 
 	bool isComplete() const { return kind == Any || sized; }
@@ -209,6 +213,9 @@
 	virtual void accept( Visitor &v ) { v.visit( this ); }
 	virtual TypeDecl *acceptMutator( Mutator &m ) { return m.mutate( this ); }
+	virtual void print( std::ostream &os, int indent = 0 ) const;
+
   private:
 	Kind kind;
+	Type * init;
 	bool sized;
 };
Index: src/SynTree/Mutator.cc
===================================================================
--- src/SynTree/Mutator.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SynTree/Mutator.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -77,4 +77,5 @@
 TypeDecl *Mutator::mutate( TypeDecl *typeDecl ) {
 	handleNamedTypeDecl( typeDecl );
+	typeDecl->set_init( maybeMutate( typeDecl->get_init(), *this ) );
 	return typeDecl;
 }
Index: src/SynTree/TypeDecl.cc
===================================================================
--- src/SynTree/TypeDecl.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SynTree/TypeDecl.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -18,8 +18,12 @@
 #include "Common/utility.h"
 
-TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind ) : Parent( name, scs, type ), kind( kind ), sized( kind == Any || kind == Ttype ) {
+TypeDecl::TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, Type * init ) : Parent( name, scs, type ), kind( kind ), init( init ), sized( kind == Any || kind == Ttype ) {
 }
 
-TypeDecl::TypeDecl( const TypeDecl &other ) : Parent( other ), kind( other.kind ), sized( other.sized ) {
+TypeDecl::TypeDecl( const TypeDecl &other ) : Parent( other ), kind( other.kind ), init( maybeClone( other.init ) ), sized( other.sized ) {
+}
+
+TypeDecl::~TypeDecl() {
+  delete init;
 }
 
@@ -34,4 +38,13 @@
 }
 
+void TypeDecl::print( std::ostream &os, int indent ) const {
+  NamedTypeDecl::print( os, indent );
+  if ( init ) {
+    os << std::endl << std::string( indent, ' ' ) << "with type initializer: ";
+    init->print( os, indent + 2 );
+  }
+}
+
+
 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ) {
   return os << data.kind << ", " << data.isComplete;
Index: src/SynTree/Visitor.cc
===================================================================
--- src/SynTree/Visitor.cc	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/SynTree/Visitor.cc	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -67,4 +67,5 @@
 void Visitor::visit( TypeDecl *typeDecl ) {
 	handleNamedTypeDecl( static_cast< NamedTypeDecl* >( typeDecl ) );
+	maybeAccept( typeDecl->get_init(), *this );
 }
 
Index: src/libcfa/containers/vector
===================================================================
--- src/libcfa/containers/vector	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/libcfa/containers/vector	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -22,4 +22,34 @@
 
 //------------------------------------------------------------------------------
+//Allocator
+forall(otype T)
+struct heap_allocator
+{
+	T* storage;
+	size_t capacity;
+};
+
+forall(otype T)
+void ?{}(heap_allocator(T)* this);
+
+forall(otype T)
+void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs);
+
+forall(otype T)
+heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs);
+
+forall(otype T)
+void ^?{}(heap_allocator(T)* this);
+
+forall(otype T)
+void realloc_storage(heap_allocator(T)* this, size_t size);
+
+forall(otype T)
+static inline T* data(heap_allocator(T)* this)
+{
+	return this->storage;
+}
+
+//------------------------------------------------------------------------------
 //Declaration
 trait allocator_c(otype T, otype allocator_t)
@@ -29,5 +59,5 @@
 };
 
-forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
+forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t))
 struct vector;
 
@@ -46,5 +76,5 @@
 void ^?{}(vector(T, allocator_t)* this);
 
-forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
+forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t))
 struct vector
 {
@@ -136,34 +166,4 @@
 // }
 
-//------------------------------------------------------------------------------
-//Allocator
-forall(otype T)
-struct heap_allocator
-{
-	T* storage;
-	size_t capacity;
-};
-
-forall(otype T)
-void ?{}(heap_allocator(T)* this);
-
-forall(otype T)
-void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs);
-
-forall(otype T)
-heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs);
-
-forall(otype T)
-void ^?{}(heap_allocator(T)* this);
-
-forall(otype T)
-void realloc_storage(heap_allocator(T)* this, size_t size);
-
-forall(otype T)
-static inline T* data(heap_allocator(T)* this)
-{
-	return this->storage;
-}
-
 #endif // VECTOR_H
 
Index: src/tests/libcfa_vector.c
===================================================================
--- src/tests/libcfa_vector.c	(revision ff03f5cd8341dad2144710b51063ff0071ec6107)
+++ src/tests/libcfa_vector.c	(revision 67cf18c3e5b8ae6e923fa93e69357ba5e746bf57)
@@ -27,5 +27,5 @@
 
 int main() {
-	vector( int, heap_allocator(int) ) iv;
+	vector( int ) iv;
 
 	assert( empty( &iv ) );
