1-
21# # each entry in the typeDeclarationList
32# # gives a function to convert the arguments of a
43# # type declaration into a symbol object.
@@ -237,7 +236,7 @@ typeDeclarationList <- list(
237236 RcppFunction = function (... ) {
238237 symbolRcppType $ new(RcppType = " Rcpp::Function" , ... )
239238 },
240-
239+
241240 # # RcppEigen RcppTypes
242241 RcppEigenMatrixXd = function (... ) {
243242 symbolRcppType $ new(RcppType = " Eigen::MatrixXd" , ... )
@@ -257,7 +256,7 @@ typeDeclarationList <- list(
257256 RcppEigenVectorXcd = function (... ) {
258257 symbolRcppType $ new(RcppType = " Eigen::VectorXcd" , ... )
259258 },
260-
259+
261260 # # Sparse types
262261 nSparseMatrix = function (value ,
263262 ... ,
@@ -290,7 +289,7 @@ typeDeclarationList <- list(
290289 nDim < = 6 ))
291290 stop(paste0(" Invalid number of dimensions used to declare a.nCompiler " ,
292291 " argument. Dimensions from 0-6 are allowed." ),
293- call. = FALSE )
292+ call. = FALSE )
294293 nType(scalarType , nDim )
295294 },
296295 CppVar = function (... ) { # symbolBaseArgs will be passed to symbolBase$initialize
@@ -351,12 +350,12 @@ argType2symbol <- function(argType,
351350 # # allow e.g. 'scalarInteger' to become scalarInteger()
352351 if (is.name(typeToUse ))
353352 typeToUse <- as.call(list (typeToUse ))
354-
353+
355354 # # argType could be a blank
356355 if (is.name(argType ))
357356 if (as.character(argType )== " " )
358357 argType <- NULL
359-
358+
360359 ans <- try({
361360 # # TO-DO: Case 1: It is a nType object
362361 # # To be implemented
@@ -427,8 +426,8 @@ argType2symbol <- function(argType,
427426 # # Case 3: It is a nClass type or possibly other "to-be-determined" type.
428427 # # We defer type lookup until compiler stage labelAbstractTypes
429428 if (inputAsCharacter ) {
430- symbol <- symbolTBD $ new(name = name ,
431- type = funName ,
429+ symbol <- symbolTBD $ new(name = name ,
430+ type = funName ,
432431 isArg = isArg )
433432 } else {
434433 # # Case 4: Type can be determined by evaluating the default
@@ -461,7 +460,7 @@ argType2symbol <- function(argType,
461460 call. = FALSE )
462461 }
463462 if (isTRUE(symbol $ isRef )) {
464-
463+
465464 }
466465 nErrorEnv $ .isRef_has_been_set <- FALSE
467466 nErrorEnv $ .isBlockRef_has_been_set <- FALSE
@@ -515,7 +514,7 @@ argTypeList2symbolTable <- function(argTypeList,
515514 }
516515 if (is.null(names(isArg )))
517516 names(isArg ) <- names(argTypeList )
518-
517+
519518 # # Check that isRef is valid
520519 if (! is.list(isRef )) {
521520 ok <- FALSE
@@ -617,11 +616,19 @@ resolveOneTBDsymbol <- function(symbol, env = parent.frame()) {
617616 NCgenerator = candidate )
618617 return (newSym )
619618 }
619+ } else if (inherits(symbol , " symbolNlist" )) {
620+ elementSym <- symbol $ elementSym
621+ if (inherits(elementSym , " symbolTBD" )) {
622+ elementSym <- resolveOneTBDsymbol(elementSym , env )
623+ newSym <- symbol $ clone(deep = TRUE )
624+ newSym $ elementSym <- elementSym
625+ return (newSym )
626+ }
620627 }
621628 symbol # return unmodified symbol if nothing to do
622629}
623630
624- resolveTBDsymbols <- function (symTab ,
631+ resolveTBDsymbols <- function (symTab ,
625632 env = parent.frame()) {
626633 for (i in seq_along(symTab $ symbols )) {
627634 symTab $ symbols [[i ]] <- resolveOneTBDsymbol(symTab $ symbols [[i ]], env )
0 commit comments