Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -1382,5 +1382,5 @@
 				}
 			}
-			
+
 			CandidateRef newCand = std::make_shared<Candidate>(
 				newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, bentConversion? Cost::safe: Cost::zero,
@@ -1776,5 +1776,4 @@
 						auto commonAsEnumAttr = common.as<ast::EnumAttrType>();
 						if ( commonAsEnumAttr && commonAsEnumAttr->attr == ast::EnumAttribute::Value ) {
-							
 							auto callExpr = new ast::UntypedExpr(
 								cand->expr->location, new ast::NameExpr( cand->expr->location, "valueE"), {cand->expr} );
@@ -1805,8 +1804,8 @@
 							// if this somehow changes in the future (e.g. delayed by indeterminate return type)
 							// we may need to revisit the logic.
-							inferParameters( newCand, matches );	
+							inferParameters( newCand, matches );
 						}
-					}			
-				}	
+					}
+				}
 			}
 		}
@@ -2161,5 +2160,5 @@
 			}
 		),
-		new ast::BasicType( ast::BasicType::SignedInt )
+		new ast::BasicType( ast::BasicKind::SignedInt )
 	);
 }
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -30,10 +30,10 @@
 struct CandidateFinder {
 	CandidateList candidates;          ///< List of candidate resolutions
-	const ResolveContext & context;  ///< Information about where the canditates are being found.
+	const ResolveContext & context;    ///< Information about where the canditates are being found.
 	const ast::TypeEnvironment & env;  ///< Substitutions performed in this resolution
 	ast::ptr< ast::Type > targetType;  ///< Target type for resolution
 	bool strictMode = false;           ///< If set to true, requires targetType to be exact match (inside return cast)
 	bool allowVoid = false;            ///< If set to true, allow void-returning function calls (only top level, cast to void and first in comma)
-	std::set< std::string > otypeKeys;  /// different type may map to same key
+	std::set< std::string > otypeKeys; ///< different type may map to same key
 
 	CandidateFinder(
@@ -70,6 +70,8 @@
 	const ast::Expr * expr, Cost & cost );
 
-const ast::Expr * getValueEnumCall(const ast::Expr * expr,
-	const ResolvExpr::ResolveContext & context, const ast::TypeEnvironment & env );
+/// Get the valueE application that returns the enum's value.
+const ast::Expr * getValueEnumCall( const ast::Expr * expr,
+	const ResolveContext & context, const ast::TypeEnvironment & env );
+
 /// Wrap an expression to convert the result to a conditional result.
 const ast::Expr * createCondExpr( const ast::Expr * expr );
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/CommonType.cc	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -38,6 +38,6 @@
 	// GENERATED START, DO NOT EDIT
 	// GENERATED BY BasicTypes-gen.cc
-	#define BT ast::BasicType::
-	static const BT Kind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor
+	#define BT ast::BasicKind::
+	static const ast::BasicKind commonTypes[BT NUMBER_OF_BASIC_TYPES][BT NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor
 		/*		                        B                       C                      SC                      UC                      SI                     SUI
 				                        I                      UI                      LI                     LUI                     LLI                    LLUI
@@ -339,5 +339,5 @@
 	// GENERATED END
 	static_assert(
-		sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::BasicType::NUMBER_OF_BASIC_TYPES * ast::BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(commonTypes)/sizeof(commonTypes[0][0]) == ast::BasicKind::NUMBER_OF_BASIC_TYPES * ast::BasicKind::NUMBER_OF_BASIC_TYPES,
 		"Each basic type kind should have a corresponding row in the combined type matrix"
 	);
@@ -366,5 +366,5 @@
 	void postvisit( const ast::BasicType * basic ) {
 		if ( auto basic2 = dynamic_cast< const ast::BasicType * >( type2 ) ) {
-			ast::BasicType::Kind kind;
+			ast::BasicKind kind;
 			if (basic->kind != basic2->kind && !widen.first && !widen.second) return;
 			else if (!widen.first) kind = basic->kind; // widen.second
@@ -386,5 +386,5 @@
 			const ast::EnumDecl* enumDecl = enumInst->base;
 			if ( !enumDecl->base ) {
-				ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];
+				ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ];
 				if (
 					( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
@@ -398,5 +398,5 @@
 		} else if ( auto type2AsAttr = dynamic_cast< const ast::EnumAttrType * >( type2 ) ) {
             if ( type2AsAttr->attr == ast::EnumAttribute::Posn ) {
-			    ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];
+			    ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ];
 			    if (
 				    ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
@@ -649,5 +649,5 @@
 	void postvisit( const ast::EnumInstType * enumInst ) {
 		if ( enumInst->base && !enumInst->base->base ) {
-			auto basicType = new ast::BasicType( ast::BasicType::UnsignedInt );
+			auto basicType = new ast::BasicType( ast::BasicKind::UnsignedInt );
 			result = commonType( basicType, type2, tenv, need, have, open, widen);
 		}
@@ -674,5 +674,5 @@
 		} else if ( widen.second && dynamic_cast< const ast::OneType * >( type2 ) ) {
 			result = new ast::BasicType{
-				ast::BasicType::SignedInt, zero->qualifiers | type2->qualifiers };
+				ast::BasicKind::SignedInt, zero->qualifiers | type2->qualifiers };
 		} else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) {
 			const ast::EnumDecl * enumDecl = enumInst->base;
@@ -695,5 +695,5 @@
 		} else if ( widen.second && dynamic_cast< const ast::ZeroType * >( type2 ) ) {
 			result = new ast::BasicType{
-				ast::BasicType::SignedInt, one->qualifiers | type2->qualifiers };
+				ast::BasicKind::SignedInt, one->qualifiers | type2->qualifiers };
 		} else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) {
 			const ast::EnumDecl * enumDecl = enumInst->base;
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/ConversionCost.cc	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -59,5 +59,5 @@
 	// GENERATED START, DO NOT EDIT
 	// GENERATED BY BasicTypes-gen.cc
-	static const int costMatrix[ast::BasicType::NUMBER_OF_BASIC_TYPES][ast::BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
+	static const int costMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
 		/*               B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X_FDXC  F80  _FB_FLDC   FB   LD  LDC _FBX_FLDXC */
 		/*      B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17, },
@@ -101,5 +101,5 @@
 	// GENERATED END
 	static_assert(
-		sizeof(costMatrix)/sizeof(costMatrix[0][0]) == ast::BasicType::NUMBER_OF_BASIC_TYPES * ast::BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(costMatrix)/sizeof(costMatrix[0][0]) == ast::BasicKind::NUMBER_OF_BASIC_TYPES * ast::BasicKind::NUMBER_OF_BASIC_TYPES,
 		"Missing row in the cost matrix"
 	);
@@ -107,5 +107,5 @@
 	// GENERATED START, DO NOT EDIT
 	// GENERATED BY BasicTypes-gen.cc
-	static const int signMatrix[ast::BasicType::NUMBER_OF_BASIC_TYPES][ast::BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
+	static const int signMatrix[ast::BasicKind::NUMBER_OF_BASIC_TYPES][ast::BasicKind::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
 		/*               B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X_FDXC  F80  _FB_FLDC   FB   LD  LDC _FBX_FLDXC */
 		/*      B */ {   0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
@@ -148,5 +148,5 @@
 	// GENERATED END
 	static_assert(
-		sizeof(signMatrix)/sizeof(signMatrix[0][0]) == ast::BasicType::NUMBER_OF_BASIC_TYPES * ast::BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(signMatrix)/sizeof(signMatrix[0][0]) == ast::BasicKind::NUMBER_OF_BASIC_TYPES * ast::BasicKind::NUMBER_OF_BASIC_TYPES,
 		"Missing row in the sign matrix"
 	);
@@ -279,5 +279,5 @@
 		conversionCostFromBasicToBasic( basicType, dstAsBasic );
 	} else if ( dynamic_cast< const ast::EnumAttrType *>(dst) ) {
-		static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };
+		static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
 		cost = costCalc( basicType, integer, srcIsLvalue, symtab, env );
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
@@ -369,6 +369,7 @@
 			}
 		}
-	} 
-	static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };
+		return;
+	}
+	static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
 	cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
 	if ( cost < Cost::unsafe ) {
@@ -395,5 +396,5 @@
 		    if ( cost < Cost::unsafe ) cost.incSafe();
 	    } else {
-		    static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicType::SignedInt ) };
+		    static ast::ptr<ast::BasicType> integer = { new ast::BasicType( ast::BasicKind::SignedInt ) };
 		    cost = costCalc( integer, dst, srcIsLvalue, symtab, env );
 		    if ( cost < Cost::unsafe ) {
@@ -460,5 +461,5 @@
 	} else if ( const ast::BasicType * dstAsBasic =
 			dynamic_cast< const ast::BasicType * >( dst ) ) {
-		int tableResult = costMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ];
+		int tableResult = costMatrix[ ast::BasicKind::SignedInt ][ dstAsBasic->kind ];
 		if ( -1 == tableResult ) {
 			cost = Cost::unsafe;
@@ -466,5 +467,5 @@
 			cost = Cost::zero;
 			cost.incSafe( tableResult + 1 );
-			cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] );
+			cost.incSign( signMatrix[ ast::BasicKind::SignedInt ][ dstAsBasic->kind ] );
 		}
 		// this has the effect of letting any expr such as x+0, x+1 to be typed
@@ -492,5 +493,5 @@
 	} else if ( const ast::BasicType * dstAsBasic =
 			dynamic_cast< const ast::BasicType * >( dst ) ) {
-		int tableResult = costMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ];
+		int tableResult = costMatrix[ ast::BasicKind::SignedInt ][ dstAsBasic->kind ];
 		if ( -1 == tableResult ) {
 			cost = Cost::unsafe;
@@ -498,5 +499,5 @@
 			cost = Cost::zero;
 			cost.incSafe( tableResult + 1 );
-			cost.incSign( signMatrix[ ast::BasicType::SignedInt ][ dstAsBasic->kind ] );
+			cost.incSign( signMatrix[ ast::BasicKind::SignedInt ][ dstAsBasic->kind ] );
 		}
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
Index: src/ResolvExpr/PtrsCastable.cc
===================================================================
--- src/ResolvExpr/PtrsCastable.cc	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/PtrsCastable.cc	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -100,5 +100,5 @@
 				result = 1;
 			} else if ( auto bt = dynamic_cast< const ast::BasicType * >( dst ) ) {
-				if ( bt->kind == ast::BasicType::SignedInt ) {
+				if ( bt->kind == ast::BasicKind::SignedInt ) {
 					result = 0;
 				} else {
Index: src/ResolvExpr/ResolveTypeof.cc
===================================================================
--- src/ResolvExpr/ResolveTypeof.cc	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/ResolveTypeof.cc	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -63,5 +63,5 @@
 			if ( newType.as< ast::EnumInstType >() ) {
 				newType = new ast::BasicType(
-					ast::BasicType::SignedInt, newType->qualifiers, copy(newType->attributes) );
+					ast::BasicKind::SignedInt, newType->qualifiers, copy(newType->attributes) );
 			}
 			reset_qualifiers(
@@ -91,5 +91,5 @@
 		auto mutType = mutate(arrayType);
 		auto globalSizeType = context.global.sizeType;
-		ast::ptr<ast::Type> sizetype = globalSizeType ? globalSizeType : new ast::BasicType(ast::BasicType::LongUnsignedInt);
+		ast::ptr<ast::Type> sizetype = globalSizeType ? globalSizeType : new ast::BasicType( ast::BasicKind::LongUnsignedInt );
 		mutType->dimension = findSingleExpression(arrayType->dimension, sizetype, context );
 
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 748c7516ae55669d37dd519860c23a7cc8c8632b)
+++ src/ResolvExpr/Resolver.cc	(revision 38093ae64b024ab4c59bfa2d4555f10ec56e103e)
@@ -351,7 +351,7 @@
 	bool isCharType( const ast::Type * t ) {
 		if ( auto bt = dynamic_cast< const ast::BasicType * >( t ) ) {
-			return bt->kind == ast::BasicType::Char
-				|| bt->kind == ast::BasicType::SignedChar
-				|| bt->kind == ast::BasicType::UnsignedChar;
+			return bt->kind == ast::BasicKind::Char
+				|| bt->kind == ast::BasicKind::SignedChar
+				|| bt->kind == ast::BasicKind::UnsignedChar;
 		}
 		return false;
@@ -458,5 +458,5 @@
 			if (attr->params.size() == 1) {
 				auto arg = attr->params.front();
-				auto resolved = ResolvExpr::findSingleExpression( arg, new ast::BasicType( ast::BasicType::LongLongSignedInt ), context );
+				auto resolved = ResolvExpr::findSingleExpression( arg, new ast::BasicType( ast::BasicKind::LongLongSignedInt ), context );
 				auto result = eval(arg);
 
@@ -624,5 +624,5 @@
 			objectDecl = fixObjectType( objectDecl, context );
 			currentObject = ast::CurrentObject{
-				objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
+				objectDecl->location, new ast::BasicType{ ast::BasicKind::SignedInt } };
 		}
 	} else {
@@ -1095,5 +1095,5 @@
 		// resolve the timeout as a size_t, the conditions like IfStmt, and stmts normally
 		ast::ptr< ast::Type > target =
-			new ast::BasicType{ ast::BasicType::LongLongUnsignedInt };
+			new ast::BasicType{ ast::BasicKind::LongLongUnsignedInt };
 		auto timeout_time = findSingleExpression( stmt->timeout_time, target, context );
 		auto timeout_cond = findCondExpression( stmt->timeout_cond, context );
