Crystal: Better error output for infinitely recursive macros

Created on 3 Jun 2020  路  2Comments  路  Source: crystal-lang/crystal

Attempting to compile an infinitely recursive macro provides little feedback to the developer.

macro foo
  foo
end

foo
Stack overflow (e.g., infinite or very deep recursion)
[0x7f366bf645e6] ???
[0x7f366beb3292] ???
[0x7f366cd31b91] ???



md5-5720f45ccb85548e6dd032156bf91b53



Crystal 0.34.0 [4401e90f0] (2020-04-06)

LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu



md5-8d4a3d28ffda5733a2da4f693d372791



There was a problem expanding macro 'foo'

Code in src/test.cr:5:1

 5 | foo
     ^

Error: expansion of macro 'foo' resulted in stack overflow (e.g, infinite or very deep recursion)
feature compiler topicmacros

Most helpful comment

Not a duplicate. Macro evaluation should probably have a max depth. I'm not sure.

All 2 comments

Not a duplicate. Macro evaluation should probably have a max depth. I'm not sure.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgphp picture lgphp  路  3Comments

lbguilherme picture lbguilherme  路  3Comments

will picture will  路  3Comments

asterite picture asterite  路  3Comments

costajob picture costajob  路  3Comments