nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

Block in template meddling with stacktrace #11644

Open Wh1teDuke opened 5 years ago

Wh1teDuke commented 5 years ago

Test

# Module A(1)
template test* =
  assert false # L2
# Module A(2)
template test* =
  block: assert false # L2
# Module B
proc main = # L8
  test() # L9

main() # L12

StackTrace with A1 (No Block)

# Both B
B.nim(12) B
B.nim(9) main

StackTrace with A2 (Block)

# B / A
B.nim(12) B
A.nim(2) main

Expected 'A' module needs to be acknowledged. Preferably:

B.nim(12) B
B.nim(9) main
A.nim(2) main

>nim -v
Nim Compiler Version 0.20.99 [Linux: i386]
Compiled at 2019-07-01
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 766960dc15ad29a4d45a71ce24136bea0eba2268
active boot switches: -d:release
mratsim commented 5 years ago

Oh I think you pinpointed one of the my main Nim mystery issue. "Why was that stacktrace eaten?".