stevedlawrence commented on a change in pull request #207: Added support for 
enumerations and TypeValueCalc
URL: https://github.com/apache/incubator-daffodil/pull/207#discussion_r278613692
 
 

 ##########
 File path: 
daffodil-core/src/main/scala/org/apache/daffodil/dsom/SimpleTypes.scala
 ##########
 @@ -221,64 +310,410 @@ final class LocalSimpleTypeDef(
     //
     // TODO: implement a daf:name property to give an alternate name. If 
present, use that.
     //
-    val rName = optRestriction.flatMap { r =>
+    val baseName = optRestriction.flatMap { r =>
       r.optBaseDef.map { _.namedQName }.orElse(Some(r.primType.globalQName))
     }.getOrElse(this.optUnion.map { u => u.primType.globalQName }.getOrElse(
-      Assert.invariantFailed("Simple type is neither a union nor a 
restriction: " + this)))
-    rName.toQNameString
+      //Note that this.toString=diagnosticDebugName, so cannot be used here
+      Assert.invariantFailed("Anonymous Simple type is neither a union nor a 
restriction. Enclosing element is " + this.parent)))
+    val repName = optRepTypeFactory.map(_.name)
+    repName match{
+      case None => baseName.diagnosticDebugName
+      case Some(n) => s"${n} -> ${baseName.diagnosticDebugName}"
 
 Review comment:
   This seems like an odd debug name for an element. I'm not sure how much it 
matters, but this definitately won't be a valid qname.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to