Index: src/AST/Convert.cpp
===================================================================
--- src/AST/Convert.cpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/Convert.cpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -10,6 +10,6 @@
 // Created On       : Thu May 09 15::37::05 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Dec 10 22:20:10 2019
-// Update Count     : 32
+// Last Modified On : Wed Dec 11 21:39:32 2019
+// Update Count     : 33
 //
 
@@ -1223,5 +1223,5 @@
 				cv( node ),
 				node->name,
-				node->kind == ast::TypeVar::Ftype,
+				node->kind == ast::TypeDecl::Ftype,
 				get<Attribute>().acceptL( node->attributes )
 			};
@@ -1578,5 +1578,5 @@
 			{ old->storageClasses.val },
 			GET_ACCEPT_1(base, Type),
-			(ast::TypeVar::Kind)(unsigned)old->kind,
+			(ast::TypeDecl::Kind)(unsigned)old->kind,
 			old->sized,
 			GET_ACCEPT_1(init, Type)
@@ -2561,5 +2561,5 @@
 			ty = new ast::TypeInstType{
 				old->name,
-				old->isFtype ? ast::TypeVar::Ftype : ast::TypeVar::Dtype,
+				old->isFtype ? ast::TypeDecl::Ftype : ast::TypeDecl::Dtype,
 				cv( old ),
 				GET_ACCEPT_V( attributes, Attribute )
Index: src/AST/Decl.cpp
===================================================================
--- src/AST/Decl.cpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/Decl.cpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -10,6 +10,6 @@
 // Created On       : Thu May 9 10:00:00 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Dec 11 16:41:39 2019
-// Update Count     : 18
+// Last Modified On : Fri Dec 13 16:23:15 2019
+// Update Count     : 20
 //
 
@@ -26,5 +26,4 @@
 #include "Node.hpp"            // for readonly
 #include "Type.hpp"            // for readonly
-#include "Parser/ParseNode.h"  // for DeclarationNode
 
 namespace ast {
@@ -56,15 +55,14 @@
 
 const char * TypeDecl::typeString() const {
-	static const char * kindNames[] = { "sized object type", "sized function type", "sized tuple type" };
-	assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1,
-		"typeString: kindNames is out of sync." );
-	assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
+	static const char * kindNames[] = { "sized data type", "sized object type", "sized function type", "sized tuple type" };
+	static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "typeString: kindNames is out of sync." );
+	assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
 	return sized ? kindNames[ kind ] : &kindNames[ kind ][ sizeof("sized") ]; // sizeof includes '\0'
 }
 
 const char * TypeDecl::genTypeString() const {
-	static const char * kindNames[] = { "dtype", "ftype", "ttype" };
-	assertf( sizeof(kindNames)/sizeof(kindNames[0]) == DeclarationNode::NoTypeClass-1, "genTypeString: kindNames is out of sync." );
-	assertf( kind < sizeof(kindNames)/sizeof(kindNames[0]), "TypeDecl's kind is out of bounds." );
+	static const char * kindNames[] = { "dtype", "otype", "ftype", "ttype" };
+	static_assert( sizeof(kindNames)/sizeof(kindNames[0]) == TypeDecl::NUMBER_OF_KINDS, "genTypeString: kindNames is out of sync." );
+	assertf( kind < TypeDecl::NUMBER_OF_KINDS, "TypeDecl kind is out of bounds." );
 	return kindNames[ kind ];
 }
Index: src/AST/Decl.hpp
===================================================================
--- src/AST/Decl.hpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/Decl.hpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -10,6 +10,6 @@
 // Created On       : Thu May 9 10:00:00 2019
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Wed Dec 11 08:20:20 2019
-// Update Count     : 16
+// Last Modified On : Fri Dec 13 17:38:33 2019
+// Update Count     : 29
 //
 
@@ -20,4 +20,5 @@
 #include <unordered_map>
 #include <vector>
+#include <algorithm>
 
 #include "FunctionSpec.hpp"
@@ -27,7 +28,7 @@
 #include "ParseNode.hpp"
 #include "StorageClasses.hpp"
-#include "TypeVar.hpp"
 #include "Visitor.hpp"
-#include "Parser/ParseNode.h"  // for DeclarationNode::Aggregate
+#include "Common/utility.h"
+#include "Common/SemanticError.h"						// error_str
 
 // Must be included in *all* AST classes; should be #undef'd at the end of the file
@@ -125,5 +126,5 @@
 	std::vector< ptr<Expr> > withExprs;
 
-	FunctionDecl( const CodeLocation & loc, const std::string &name, FunctionType * type,
+	FunctionDecl( const CodeLocation & loc, const std::string & name, FunctionType * type,
 		CompoundStmt * stmts, Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::C,
 		std::vector<ptr<Attribute>>&& attrs = {}, Function::Specs fs = {})
@@ -136,5 +137,5 @@
 	bool has_body() const { return stmts; }
 
-	const DeclWithType * accept( Visitor &v ) const override { return v.visit( this ); }
+	const DeclWithType * accept( Visitor & v ) const override { return v.visit( this ); }
 private:
 	FunctionDecl * clone() const override { return new FunctionDecl( *this ); }
@@ -163,6 +164,8 @@
 /// Cforall type variable: `dtype T`
 class TypeDecl final : public NamedTypeDecl {
-public:
-	TypeVar::Kind kind;
+  public:
+	enum Kind { Dtype, Otype, Ftype, Ttype, NUMBER_OF_KINDS };
+
+	Kind kind;
 	bool sized;
 	ptr<Type> init;
@@ -170,23 +173,21 @@
 	/// Data extracted from a type decl
 	struct Data {
-		TypeVar::Kind kind;
+		Kind kind;
 		bool isComplete;
 
-		Data() : kind( (TypeVar::Kind)-1 ), isComplete( false ) {}
+		Data() : kind( NUMBER_OF_KINDS ), isComplete( false ) {}
 		Data( const TypeDecl * d ) : kind( d->kind ), isComplete( d->sized ) {}
-		Data( TypeVar::Kind k, bool c ) : kind( k ), isComplete( c ) {}
+		Data( Kind k, bool c ) : kind( k ), isComplete( c ) {}
 		Data( const Data & d1, const Data & d2 )
-		: kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
-
-		bool operator== ( const Data & o ) const {
-			return kind == o.kind && isComplete == o.isComplete;
-		}
-		bool operator!= ( const Data & o ) const { return !(*this == o); }
+			: kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
+
+		bool operator==( const Data & o ) const { return kind == o.kind && isComplete == o.isComplete; }
+		bool operator!=( const Data & o ) const { return !(*this == o); }
 	};
 
-	TypeDecl( const CodeLocation& loc, const std::string& name, Storage::Classes storage, Type* b,
-		TypeVar::Kind k, bool s, Type* i = nullptr )
-	: NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == TypeVar::Ttype || s ),
-	  init( i ) {}
+	TypeDecl( const CodeLocation & loc, const std::string & name, Storage::Classes storage, Type * b,
+			  Kind k, bool s, Type * i = nullptr )
+		: NamedTypeDecl( loc, name, storage, b ), kind( k ), sized( k == Ttype || s ),
+		init( i ) {}
 
 	const char * typeString() const override;
@@ -198,5 +199,5 @@
 
 	const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
-private:
+  private:
 	TypeDecl * clone() const override { return new TypeDecl{ *this }; }
 	MUTATE_FRIEND
@@ -343,10 +344,10 @@
 	ptr<AsmStmt> stmt;
 
-	AsmDecl( const CodeLocation & loc, AsmStmt *stmt )
+	AsmDecl( const CodeLocation & loc, AsmStmt * stmt )
 	: Decl( loc, "", {}, {} ), stmt(stmt) {}
 
-	const AsmDecl * accept( Visitor &v ) const override { return v.visit( this ); }
-private:
-	AsmDecl *clone() const override { return new AsmDecl( *this ); }
+	const AsmDecl * accept( Visitor & v ) const override { return v.visit( this ); }
+private:
+	AsmDecl * clone() const override { return new AsmDecl( *this ); }
 	MUTATE_FRIEND
 };
@@ -360,5 +361,5 @@
 	: Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {}
 
-	const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); }
+	const StaticAssertDecl * accept( Visitor & v ) const override { return v.visit( this ); }
 private:
 	StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); }
Index: src/AST/Print.cpp
===================================================================
--- src/AST/Print.cpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/Print.cpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -1359,5 +1359,5 @@
 		preprint( node );
 		os << "instance of type " << node->name
-		   << " (" << (node->kind == ast::TypeVar::Ftype ? "" : "not ") << "function type)";
+		   << " (" << (node->kind == ast::TypeDecl::Ftype ? "" : "not ") << "function type)";
 		print( node->params );
 
Index: src/AST/Type.hpp
===================================================================
--- src/AST/Type.hpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/Type.hpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -9,7 +9,7 @@
 // Author           : Aaron B. Moss
 // Created On       : Thu May 9 10:00:00 2019
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Thu May 9 10:00:00 2019
-// Update Count     : 1
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec 11 21:56:46 2019
+// Update Count     : 5
 //
 
@@ -26,5 +26,4 @@
 #include "Fwd.hpp"
 #include "Node.hpp"          // for Node, ptr, ptr_base
-#include "TypeVar.hpp"
 #include "Visitor.hpp"
 
@@ -423,10 +422,10 @@
 public:
 	readonly<TypeDecl> base;
-	TypeVar::Kind kind;
+	TypeDecl::Kind kind;
 
 	TypeInstType( const std::string& n, const TypeDecl * b, CV::Qualifiers q = {},
 		std::vector<ptr<Attribute>> && as = {} )
 	: ReferenceToType( n, q, std::move(as) ), base( b ), kind( b->kind ) {}
-	TypeInstType( const std::string& n, TypeVar::Kind k, CV::Qualifiers q = {},
+	TypeInstType( const std::string& n, TypeDecl::Kind k, CV::Qualifiers q = {},
 		std::vector<ptr<Attribute>> && as = {} )
 	: ReferenceToType( n, q, std::move(as) ), base(), kind( k ) {}
Index: src/AST/TypeEnvironment.cpp
===================================================================
--- src/AST/TypeEnvironment.cpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/TypeEnvironment.cpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -9,7 +9,7 @@
 // Author           : Aaron B. Moss
 // Created On       : Wed May 29 11:00:00 2019
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Wed May 29 11:00:00 2019
-// Update Count     : 1
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec 11 21:49:13 2019
+// Update Count     : 4
 //
 
@@ -240,5 +240,5 @@
 		return true;
 	} else if ( auto typeInst = dynamic_cast< const TypeInstType * >( type ) ) {
-		return typeInst->kind == TypeVar::Ftype;
+		return typeInst->kind == TypeDecl::Ftype;
 	} else return false;
 }
@@ -248,5 +248,5 @@
 	bool tyVarCompatible( const TypeDecl::Data & data, const Type * type ) {
 		switch ( data.kind ) {
-		  case TypeVar::Dtype:
+		  case TypeDecl::Dtype:
 			// to bind to an object type variable, the type must not be a function type.
 			// if the type variable is specified to be a complete type then the incoming
@@ -254,7 +254,7 @@
 			// xxx - should this also check that type is not a tuple type and that it's not a ttype?
 			return ! isFtype( type ) && ( ! data.isComplete || type->isComplete() );
-		  case TypeVar::Ftype:
+		  case TypeDecl::Ftype:
 			return isFtype( type );
-		  case TypeVar::Ttype:
+		  case TypeDecl::Ttype:
 			// ttype unifies with any tuple type
 			return dynamic_cast< const TupleType * >( type ) || Tuples::isTtype( type );
Index: src/AST/TypeEnvironment.hpp
===================================================================
--- src/AST/TypeEnvironment.hpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/TypeEnvironment.hpp	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -9,7 +9,7 @@
 // Author           : Aaron B. Moss
 // Created On       : Wed May 29 11:00:00 2019
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Wed May 29 11:00:00 2019
-// Update Count     : 1
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Dec 11 21:55:54 2019
+// Update Count     : 3
 //
 
@@ -28,5 +28,4 @@
 #include "Type.hpp"
 #include "TypeSubstitution.hpp"
-#include "TypeVar.hpp"
 #include "Common/Indenter.h"
 #include "ResolvExpr/WidenMode.h"
@@ -107,5 +106,5 @@
 	/// Singleton class constructor from substitution
 	EqvClass( const std::string & v, const Type * b )
-	: vars{ v }, bound( b ), allowWidening( false ), data( TypeVar::Dtype, false ) {}
+	: vars{ v }, bound( b ), allowWidening( false ), data( TypeDecl::Dtype, false ) {}
 
 	/// Single-var constructor (strips qualifiers from bound type)
Index: src/AST/TypeVar.hpp
===================================================================
--- src/AST/TypeVar.hpp	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ 	(revision )
@@ -1,34 +1,0 @@
-//
-// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
-//
-// The contents of this file are covered under the licence agreement in the
-// file "LICENCE" distributed with Cforall.
-//
-// TypeVar.hpp --
-//
-// Author           : Aaron B. Moss
-// Created On       : Wed May 15 15:00:00 2019
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Wed May 15 15:00:00 2019
-// Update Count     : 1
-//
-
-#pragma once
-
-namespace ast {
-
-namespace TypeVar {
-
-/// type variable variants.
-/// `otype` is treated as a constrainted `dtype`
-enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS };
-
-}
-
-}
-
-// Local Variables: //
-// tab-width: 4 //
-// mode: c++ //
-// compile-command: "make install" //
-// End: //
Index: src/AST/module.mk
===================================================================
--- src/AST/module.mk	(revision ab5c000833007367c4829a5114587679dea8c613)
+++ src/AST/module.mk	(revision 07de76bb7a0e1179ac6fb9bae0cb96e709315c84)
@@ -10,7 +10,7 @@
 ## Author           : Thierry Delisle
 ## Created On       : Thu May 09 16:05:36 2019
-## Last Modified By :
-## Last Modified On :
-## Update Count     :
+## Last Modified By : Peter A. Buhr
+## Last Modified On : Sat Dec 14 07:29:10 2019
+## Update Count     : 3
 ###############################################################################
 
@@ -34,6 +34,4 @@
 	AST/TypeSubstitution.cpp
 
-
-
 SRC += $(SRC_AST)
 SRCDEMANGLE += $(SRC_AST)
