Index: src/CodeGen/CodeGenerator.cc
===================================================================
--- src/CodeGen/CodeGenerator.cc	(revision 8fcf92109054723aa88873d699cd049c74f3cb44)
+++ src/CodeGen/CodeGenerator.cc	(revision 34a1d2e59f01760d508228626f767d567ef45b31)
@@ -273,10 +273,31 @@
 	}
 
+	template<typename pass_type>
+	inline void genEnumInitializer( PassVisitor<pass_type> * visitor, Type * baseType, std::ostream & output,
+	Initializer * init, long long * cur_val, Options options) {
+		auto baseTypeAsBasic = baseType ? dynamic_cast<BasicType *>( baseType ) : nullptr;
+		if ( init ) { // If value has an explicit initiazatior 
+			output << " = "; 
+			output << "(" << genType(baseType, "", options) << ")";
+			init->accept( *visitor );
+			if ( baseTypeAsBasic && baseTypeAsBasic->isInteger() ) { // if it is an integral type and initilizer offered, 
+			// need to update the cur_val
+				Expression* expr = ((SingleInit *)(init))->value;
+				while ( auto temp = dynamic_cast<CastExpr *>(expr) ) { // unwrap introduced cast
+					expr = temp->arg;
+				}
+				*cur_val = ((ConstantExpr *)expr)->constant.get_ival()+1;
+			}
+		} else if ( baseTypeAsBasic && baseTypeAsBasic->isInteger() ) { // integral implicitly init to cur_val + 1
+			output << " = " << "(" << genType(baseType, "", options) << ")";
+			output << (*cur_val)++;
+		}
+	}
+
 	void CodeGenerator::postvisit( EnumDecl * enumDecl ) {
 		extension( enumDecl );
 		std::list< Declaration* > &memb = enumDecl->get_members();
 		if (enumDecl->base && ! memb.empty()) {
-			unsigned long long last_val = -1; // if the first enum value has no explicit initializer,
-			// as other
+			long long cur_val = 0;
 			for ( std::list< Declaration* >::iterator i = memb.begin(); i != memb.end();  i++) {
 				ObjectDecl * obj = dynamic_cast< ObjectDecl* >( *i );
@@ -284,24 +305,5 @@
 				output << "static ";
 				output << genType(enumDecl->base, mangleName( obj ), options);
-				output << " = ";
-				output << "(" << genType(enumDecl->base, "", options) << ")";
-				if ( (BasicType *)(enumDecl->base) && ((BasicType *)(enumDecl->base))->isWholeNumber() ) {
-					if ( obj->get_init() ) {
-						obj->get_init()->accept( *visitor );
-						Expression* expr = ((SingleInit *)(obj->init))->value;
-						while ( auto temp = dynamic_cast<CastExpr *>(expr) ) {
-							expr = temp->arg;
-						}
-						last_val = ((ConstantExpr *)expr)->constant.get_ival();
-					} else {
-						output << ++last_val;
-					} // if
-				} else {
-					if ( obj->get_init() ) {
-						obj->get_init()->accept( *visitor );
-					} else {
-						// Should not reach here!
-					}
-				}
+				genEnumInitializer( visitor, enumDecl->base, output, obj->get_init(), &cur_val, options);
 				output << ";" << endl;
 			} // for
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 8fcf92109054723aa88873d699cd049c74f3cb44)
+++ src/Parser/TypeData.cc	(revision 34a1d2e59f01760d508228626f767d567ef45b31)
@@ -933,5 +933,5 @@
 			member->set_init( new SingleInit( maybeMoveBuild< Expression >( cur->consume_enumeratorValue() ) ) );
 		} else if ( !cur->initializer ) {
-			if ( baseType && (!dynamic_cast<BasicType *>(baseType) || !dynamic_cast<BasicType *>(baseType)->isWholeNumber())) {
+			if ( baseType && (!dynamic_cast<BasicType *>(baseType) || !dynamic_cast<BasicType *>(baseType)->isInteger())) {
 				SemanticError( td->location, "Enumerators of an non-integer typed enum must be explicitly initialized." );
 			}
Index: src/SynTree/BasicType.cc
===================================================================
--- src/SynTree/BasicType.cc	(revision 8fcf92109054723aa88873d699cd049c74f3cb44)
+++ src/SynTree/BasicType.cc	(revision 34a1d2e59f01760d508228626f767d567ef45b31)
@@ -29,21 +29,4 @@
 }
 
-bool BasicType::isWholeNumber() const {
-	return kind == Bool || 
-		kind ==Char ||
-		kind == SignedChar ||
-		kind == UnsignedChar ||
-		kind == ShortSignedInt ||
-		kind == ShortUnsignedInt ||
-		kind == SignedInt ||
-		kind == UnsignedInt ||
-		kind == LongSignedInt ||
-		kind == LongUnsignedInt ||
-		kind == LongLongSignedInt ||
-		kind ==LongLongUnsignedInt ||
-		kind == SignedInt128 ||
-		kind == UnsignedInt128;
-}
-
 bool BasicType::isInteger() const {
 	return kind <= UnsignedInt128;
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 8fcf92109054723aa88873d699cd049c74f3cb44)
+++ src/SynTree/Type.h	(revision 34a1d2e59f01760d508228626f767d567ef45b31)
@@ -271,5 +271,4 @@
 	virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
 	virtual void print( std::ostream & os, Indenter indent = {} ) const override;
-	bool isWholeNumber() const;
 	bool isInteger() const;
 };
