Diff of /cmajor++/Cm/Cm.Core/Name.cpp [r367] .. [r368] Maximize Restore

  Switch to side-by-side view

--- a/cmajor++/Cm/Cm.Core/Name.cpp
+++ b/cmajor++/Cm/Cm.Core/Name.cpp
@@ -47,11 +47,15 @@
     if (isTypeName)
     {
         std::string ns = EnclosingScope()->GetNamespaceScope()->FullName();
-        return ns.empty() ? Object::Name() : ns + "." + Object::Name();
+        std::string fullName = ns.empty() ? Object::Name() : ns + "." + Object::Name();
+        SetFullNameCache(fullName);
+        return fullName;
     }
     else
     {
-        return Object::Name();
+        std::string fullName = Object::Name();
+        SetFullNameCache(fullName);
+        return fullName;
     }
 }
 
@@ -174,6 +178,9 @@
 
 bool Name::Bind(const TypePtr& argumentType, const ScopePtr& scope, ExpressionList& templateArguments, int& unifications, FunctionPtr& conversion, TypePtr& boundType)
 {
+#if !defined(NDEBUG) || defined(ASSERTIONS)
+    const char* fullName = GetFullNameFor(shared_from_this());
+#endif
     ObjectPtr parameterObject = scope->GetObject(Object::Name(), Lookup::this_enclosing_and_base_scope, Pos());
     if (parameterObject->IsType())
     {
@@ -192,7 +199,7 @@
     {
         ParameterPtr templateParameter = std::static_pointer_cast<Parameter>(parameterObject);
         int templateParameterIndex = templateParameter->GetIndex();
-        CM_CORE_ASSERT(templateParameterIndex >= 0 && templateParameterIndex < templateArguments.size());
+        CM_CORE_ASSERT(templateParameterIndex >= 0 && templateParameterIndex < templateArguments.size(), fullName);
         if (templateArguments[templateParameterIndex] && templateArguments[templateParameterIndex]->IsType())
         {
             TypePtr prevArgumentType = std::static_pointer_cast<Type>(templateArguments[templateParameterIndex]);