Index: src/ResolvExpr/CandidateFinder.cpp
===================================================================
--- src/ResolvExpr/CandidateFinder.cpp	(revision eb7586e994c3710bc421ab2b1c131baf040bf98d)
+++ src/ResolvExpr/CandidateFinder.cpp	(revision c333ed2955945a8e97424f193052311ca6b4131f)
@@ -2138,20 +2138,4 @@
 }
 
-// get the valueE(...) ApplicationExpr that returns the enum value
-const ast::Expr * getValueEnumCall(
-	const ast::Expr * expr,
-	const ResolvExpr::ResolveContext & context, const ast::TypeEnvironment & env ) {
-		auto callExpr = new ast::UntypedExpr(
-			expr->location, new ast::NameExpr( expr->location, "valueE"), {expr} );
-		CandidateFinder finder( context, env );
-		finder.find( callExpr );
-		CandidateList winners = findMinCost( finder.candidates );
-		if (winners.size() != 1) {
-			SemanticError( callExpr, "Ambiguous expression in valueE..." );
-		}
-		CandidateRef & choice = winners.front();
-		return choice->expr;
-}
-
 const ast::Expr * createCondExpr( const ast::Expr * expr ) {
 	assert( expr );
Index: src/ResolvExpr/CandidateFinder.hpp
===================================================================
--- src/ResolvExpr/CandidateFinder.hpp	(revision eb7586e994c3710bc421ab2b1c131baf040bf98d)
+++ src/ResolvExpr/CandidateFinder.hpp	(revision c333ed2955945a8e97424f193052311ca6b4131f)
@@ -70,8 +70,4 @@
 	const ast::Expr * expr, Cost & cost );
 
-/// 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/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision eb7586e994c3710bc421ab2b1c131baf040bf98d)
+++ src/ResolvExpr/CastCost.cc	(revision c333ed2955945a8e97424f193052311ca6b4131f)
@@ -54,7 +54,7 @@
 				cost = conversionCost( basicType, dst, srcIsLvalue, symtab, env );
 				if ( Cost::unsafe < cost ) {
-					if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
-						assert(enumInst->base->base);
-						cost = Cost::unsafe;
+					if (auto enumInst = dynamic_cast<const ast::EnumInstType *>(dst)) {
+						// Always explict cast only for typed enum
+						if (enumInst->base->isTyped) cost = Cost::unsafe;
 					}
 				}
@@ -63,33 +63,19 @@
 
 		void postvisit( const ast::ZeroType * zero ) {
-			// auto ptr = dynamic_cast< const ast::PointerType * >( dst );
-			// if ( ptr && basicType->isInteger() ) {
-			// 	// needed for, e.g. unsigned long => void *
-			// 	cost = Cost::unsafe;
-			// } else {
 			cost = conversionCost( zero, dst, srcIsLvalue, symtab, env );
 			if ( Cost::unsafe < cost ) {
 				if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
-					assert(enumInst->base->base);
-					cost = Cost::unsafe;
+					if (enumInst->base->isTyped) cost = Cost::unsafe;
 				}
 			}
-			// }
 		}
 
 		void postvisit( const ast::OneType * one ) {
-			// auto ptr = dynamic_cast< const ast::PointerType * >( dst );
-			// if ( ptr && basicType->isInteger() ) {
-			// 	// needed for, e.g. unsigned long => void *
-			// 	cost = Cost::unsafe;
-			// } else {
 			cost = conversionCost( one, dst, srcIsLvalue, symtab, env );
 			if ( Cost::unsafe < cost ) {
-				if (auto enumInst =  dynamic_cast<const ast::EnumInstType *>(dst)) {
-					assert(enumInst->base->base);
-					cost = Cost::unsafe;
+				if (auto enumInst = dynamic_cast<const ast::EnumInstType *>(dst)) {
+					if (enumInst->base->isTyped) cost = Cost::unsafe;
 				}
 			}
-			// }
 		}
 
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision eb7586e994c3710bc421ab2b1c131baf040bf98d)
+++ src/ResolvExpr/CommonType.cc	(revision c333ed2955945a8e97424f193052311ca6b4131f)
@@ -650,5 +650,5 @@
 
 	void postvisit( const ast::EnumInstType * enumInst ) {
-		if ( enumInst->base && !enumInst->base->base ) {
+		if ( enumInst->base && !enumInst->base->isTyped ) {
 			auto basicType = new ast::BasicType( ast::BasicKind::UnsignedInt );
 			result = commonType( basicType, type2, tenv, need, have, open, widen);
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision eb7586e994c3710bc421ab2b1c131baf040bf98d)
+++ src/ResolvExpr/ConversionCost.cc	(revision c333ed2955945a8e97424f193052311ca6b4131f)
@@ -283,5 +283,5 @@
 		cost = costCalc( basicType, integer, srcIsLvalue, symtab, env );
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
-		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
+		if ( dstAsEnumInst->base && !dstAsEnumInst->base->isTyped ) {
 			cost = Cost::unsafe;
 		}
@@ -480,5 +480,5 @@
 		// assuming 0p is supposed to be used for pointers?
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
-		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
+		if ( dstAsEnumInst->base && !dstAsEnumInst->base->isTyped ) {
 			cost = Cost::unsafe;
 		}
@@ -501,5 +501,5 @@
 		}
 	} else if ( auto dstAsEnumInst = dynamic_cast< const ast::EnumInstType * >( dst ) ) {
-		if ( dstAsEnumInst->base && !dstAsEnumInst->base->base ) {
+		if ( dstAsEnumInst->base && !dstAsEnumInst->base->isTyped ) {
 			cost = Cost::unsafe;
 		}
