Skip to content

ICE on static macro parameters #1108

@flaviut

Description

@flaviut
import macros

macro staticMacroBroken(dims: static[int]): stmt =
  echo dims

staticMacroBroken(0)
Traceback (most recent call last)
nimrod.nim(87)           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(1967)       semExpr
semexprs.nim(814)        semDirectOp
semexprs.nim(797)        afterCallActions
sem.nim(310)             semMacroExpr
vm.nim(1387)             evalMacroCall
vm.nim(1168)             rawExecute
vm.nim(298)              opConv
Error: unhandled exception: intVal is not accessible [EInvalidField]

Metadata

Metadata

Assignees

No one assigned

    Labels

    VMsee also `const` label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions