Skip to content

Feature request - macros: Get the NimSymKind of a NimSym #7366

@mratsim

Description

@mratsim

There doesn't seem to be a way to get the NimSymKind of a symbol.

This would be useful to check if a symbol is a var for example

import macros

var a = @[12345]

macro checkImpl(foo: varargs[typed]): untyped =
  echo foo[0].symbol.getImpl.treerepr
  # echo foo[0].symbol.kind # fails

checkImpl(a)

# Prefix
#   Sym "@"
#   Bracket
#   IntLit 12345

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions