[Rprotobuf-commits] r586 - in pkg: R vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 19 08:44:38 CET 2013


Author: murray
Date: 2013-12-19 08:44:37 +0100 (Thu, 19 Dec 2013)
New Revision: 586

Modified:
   pkg/R/containing_type.R
   pkg/vignettes/RProtoBuf-intro.Rnw
Log:
Fix a bug in containing_type() for EnumDescriptors which tries to
reference a non-existant slot.



Modified: pkg/R/containing_type.R
===================================================================
--- pkg/R/containing_type.R	2013-12-19 07:32:03 UTC (rev 585)
+++ pkg/R/containing_type.R	2013-12-19 07:44:37 UTC (rev 586)
@@ -15,9 +15,9 @@
 } )
 setMethod( "containing_type", "EnumDescriptor", function(object){
 	retval <- .Call( "EnumDescriptor__containing_type", object at pointer, PACKAGE = "RProtoBuf" )
-	if (length(retval at name) == 0) {
-                # If this enum type is nested in a message type, this is that message type.
-                # Otherwise, NULL.
+	if (length(name(retval)) == 0) {
+		# If this enum type is nested in a message type, this
+		# is that message type.	 Otherwise, NULL.
 		return(NULL)
 	} else {
                 return(retval)

Modified: pkg/vignettes/RProtoBuf-intro.Rnw
===================================================================
--- pkg/vignettes/RProtoBuf-intro.Rnw	2013-12-19 07:32:03 UTC (rev 585)
+++ pkg/vignettes/RProtoBuf-intro.Rnw	2013-12-19 07:44:37 UTC (rev 586)
@@ -1518,7 +1518,9 @@
 The \texttt{containing\_type} method can be used to retrieve the
 descriptor for the message type that contains this enum descriptor.
 
-TODO(ms): seems broken, fix it!
+<<>>=
+tutorial.Person$PhoneType$containing_type()
+@ 
 
 \subsubsection{length}
 \label{enumdescriptor-method-length}



More information about the Rprotobuf-commits mailing list