Skip to content

except: clause always called during macro expansion #1471

@ghost

Description

Consider the following example:

import macros

macro foo*(s: string{lit}) : expr =
  try:
    result = newLit(($s) & ": 42")
  except:
    result = newLit("ERROR")

echo foo("answer")

Executing this program results in "ERROR" although no exception has been raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SevereVMsee also `const` label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions