Skip to content

node not accessible compiler crash with macros #1085

@dom96

Description

@dom96
import macros

macro def(x: expr, y: stmt): stmt {.immediate.} =
  expectKind(x, nnkInfix)
  #newProc(x
  echo treeRepr(x)

def name,(a, b: cint) => nil

Crashes with:

Traceback (most recent call last)
nimrod.nim(91)           nimrod
nimrod.nim(55)           handleCmdLine
main.nim(308)            mainCommand
main.nim(73)             commandCompileToC
modules.nim(194)         compileProject
modules.nim(152)         compileModule
passes.nim(192)          processModule
passes.nim(136)          processTopLevelStmt
sem.nim(405)             myProcess
sem.nim(379)             semStmtAndGenerateGenerics
semstmts.nim(1370)       semStmt
semexprs.nim(858)        semExprNoType
semexprs.nim(1970)       semExpr
sem.nim(310)             semMacroExpr
vm.nim(1387)             evalMacroCall
vm.nim(972)              rawExecute
Error: unhandled exception: node is not accessible [EInvalidField]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions