Skip to content

char type not handled by compiler #106

@paciorek

Description

@paciorek
>   foo <- nFunction(
    fun = function() {
        y <- 'hello'
    }
  )
  cfoo <- nCompile(foo)
  cfoo()
An error occurred in compiler stage labelAbstractTypes (for method or nFunction nFun_31_NFID_35):
attempt to apply non-function
This occurred while: handling labelAbstractTypes for y.
Error in RHStype$clone() : attempt to apply non-function

Enter a frame number, or 0 to exit   

 1: nCompile(foo)
 2: nCompile_createCppDefsInfo(new_units, new_unitTypes, controlFull, new_compi
 3: nCompile_nFunction(units[[i]], stopAfterCppDef = TRUE, env = env, compileIn
 4: NF_Compiler$createCpp(control = controlFull)
 5: process(control = controlFull, sourceObj = sourceObj)
 6: processNFstages(self, controlFull, sourceObj, doKeywords, .nCompilerProject
 7: NFtry({
    compilerStage_labelAbstractTypes(NFcompiler, debug)
}, paste(stag
 8: withCallingHandlers(eval(expr, parent.frame()), error = function(e) {
    ca
 9: eval(expr, parent.frame())
10: eval(expr, parent.frame())
11: compilerStage_labelAbstractTypes(NFcompiler, debug)
12: compile_labelAbstractTypes(compileInfo$code, compileInfo$symbolTable, compi
13: compile_labelAbstractTypes(code$args[[i]], symTab, auxEnv)
14: eval(call(handler, code, symTab, auxEnv, handlingInfo), envir = labelAbstra
15: eval(call(handler, code, symTab, auxEnv, handlingInfo), envir = labelAbstra
16: Assign(<environment>, <environment>, <environment>, list(handler = "Assign"
17: AssignAfterRecursing(code, symTab, auxEnv, handlingInfo)

Selection: 17
Called from: top level 
Browse[1]> code
<-
  y
  hello
Browse[1]> RHS
hello

Looks like the char was turned into a symbol at some point.

Just noting this for now, but I'm happy to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions