@@ -100,7 +100,10 @@ compile_labelAbstractTypes <- function(code,
100100 return (invisible (NULL ))
101101 }
102102
103- handlingInfo <- getOperatorDef(code $ name , " labelAbstractTypes" )
103+ opInfo <- check_cachedOpInfo(code , where = auxEnv $ where , update = TRUE )
104+ handlingInfo <- getOperatorField(opInfo $ opDef , " labelAbstractTypes" )
105+
106+ # handlingInfo <- getOperatorDef(code$name, "labelAbstractTypes")
104107 # opInfo <- operatorDefEnv[[code$name]]
105108 # if(!is.null(opInfo)) {
106109 # handlingInfo <- opInfo[["labelAbstractTypes"]]
@@ -406,24 +409,11 @@ inLabelAbstractTypesEnv(
406409inLabelAbstractTypesEnv(
407410 nFunction_or_method_call <-
408411 function (code , symTab , auxEnv , handlingInfo ) {
409- # We have code = NFCALL_(foo(x, y))
410- # innerCall if foo(x,y)
411- # We'll set innerCall$type to symbolNF
412- # and we'll set code$type to the returnType of foo(x, y)
413- innerCall <- code $ args [[' call' ]]
414- if (is.null(innerCall ))
415- stop(
416- exprClassProcessingErrorMsg(
417- code , paste(' In nFunction_or_method_call: the nFunction (or method) ' ,
418- code $ name ,
419- ' has NULL content.' )
420- ), call. = FALSE
421- )
422- inserts <- recurse_labelAbstractTypes(innerCall , symTab , auxEnv ,
412+ inserts <- recurse_labelAbstractTypes(code , symTab , auxEnv ,
423413 handlingInfo )
424- obj_internals <- code $ aux $ obj_internals
425- nFunctionName <- code $ aux $ nFunctionName
426- innerCall $ type <- symbolNF $ new(name = nFunctionName )
414+ obj_internals <- code $ aux $ cachedOpInfo $ obj_internals
415+ # nFunctionName <- obj_internals $nFunctionName
416+ # code$aux$symbolNF <- symbolNF$new(name = nFunctionName)
427417 returnSym <- obj_internals $ returnSym
428418 if (is.null(returnSym ))
429419 stop(
@@ -435,24 +425,6 @@ inLabelAbstractTypesEnv(
435425 )
436426 code $ type <- returnSym $ clone() # # Not sure if a clone is needed, but it seems safer to make one.
437427 inserts
438-
439- # useArgs <- c(FALSE, rep(TRUE, length(code$args)-1))
440- # inserts <- recurse_labelAbstractTypes(code, symTab, auxEnv,
441- # handlingInfo, useArgs)
442- # obj_internals <- code$args[[1]]$aux$obj_internals
443- # nFunctionName <- code$args[[1]]$aux$nFunctionName
444- # code$args[[1]]$type <- symbolNF$new(name = nFunctionName)
445- # returnSym <- obj_internals$returnSym
446- # if(is.null(returnSym))
447- # stop(
448- # exprClassProcessingErrorMsg(
449- # code, paste('In nFunction_or_method_call: the nFunction (or method) ',
450- # code$name,
451- # ' does not have a valid returnType.')
452- # ), call. = FALSE
453- # )
454- # code$type <- returnSym$clone() ## Not sure if a clone is needed, but it seems safer to make one.
455- # invisible(NULL)
456428 }
457429)
458430
0 commit comments