Index: src/CodeTools/ResolvProtoDump.cc
===================================================================
--- src/CodeTools/ResolvProtoDump.cc	(revision fcc57ba616c7ee1746ee86717f162476cbb858e3)
+++ src/CodeTools/ResolvProtoDump.cc	(revision bb0f9747bb959b47f371ebe5cd2a1aa7a336a58e)
@@ -204,4 +204,11 @@
 		/// ensures type inst names are uppercase
 		static void ti_name( const std::string& name, std::stringstream& ss ) {
+			// replace built-in wide character types with named types
+			if ( name == "char16_t" || name == "char32_t" || name == "wchar_t" ) {
+				ss << "#" << name;
+				return;
+			}
+
+			// strip leading underscore
 			unsigned i = 0;
 			while ( i < name.size() && name[i] == '_' ) { ++i; }
@@ -210,6 +217,16 @@
 				return;
 			}
-			ss << (char)std::toupper( static_cast<unsigned char>(name[i]) )
-			   << (name.c_str() + i + 1);
+
+			std::string stripped = name.substr(i);
+			// strip trailing "_generic_" from autogen names (avoids some user-generation issues)
+			char generic[] = "_generic_"; size_t n_generic = sizeof(generic) - 1;
+			if ( stripped.size() >= n_generic 
+					&& stripped.substr( stripped.size() - n_generic ) == generic ) {
+				stripped.resize( stripped.size() - n_generic );
+			}
+
+			// uppercase first character
+			ss << (char)std::toupper( static_cast<unsigned char>(stripped[0]) )
+			   << (stripped.c_str() + 1);
 		}
 
@@ -397,4 +414,11 @@
 			}
 
+			/// Handle already-resolved variables as type constants
+			void previsit( VariableExpr* expr ) {
+				PassVisitor<TypePrinter> tyPrinter{ closed, ss };
+				expr->var->get_type()->accept( tyPrinter );
+				visit_children = false;
+			}
+
 			/// Calls handled as calls
 			void previsit( UntypedExpr* expr ) {
@@ -426,6 +450,8 @@
 			}
 
-			/// Already-resolved calls skipped
-			void previsit( ApplicationExpr* ) {
+			/// Already-resolved calls reduced to their type constant
+			void previsit( ApplicationExpr* expr ) {
+				PassVisitor<TypePrinter> tyPrinter{ closed, ss };
+				expr->result->accept( tyPrinter );
 				visit_children = false;
 			}
@@ -532,5 +558,4 @@
 				for ( Initializer* it : li->initializers ) {
 					build( it, ss );
-					ss << ' ';
 				}
 			}
@@ -539,7 +564,7 @@
 		/// Adds an object initializer to the list of expressions
 		void build( const std::string& name, Initializer* init, std::stringstream& ss ) {
-			ss << "$constructor( ";
+			ss << "$constructor( &";
 			rp_name( name, ss );
-			ss << "() ";
+			ss << ' ';
 			build( init, ss );
 			ss << ')';
@@ -676,4 +701,9 @@
 		}
 
+		void previsit( AsmStmt* ) {
+			// skip asm statements
+			visit_children = false;
+		}
+
 		void previsit( Expression* expr ) {
 			std::stringstream ss;
@@ -686,5 +716,5 @@
 		/// Print non-prelude global declarations for resolv proto
 		void printGlobals() const {
-			std::cout << "#ptr<T> $addr T" << std::endl;  // &?
+			std::cout << "#$ptr<T> $addr T" << std::endl;  // &?
 			int i = (int)BasicType::SignedInt;
 			std::cout << i << " $and " << i << ' ' << i << std::endl;  // ?&&?
