# this code goes `error: ‘T9_’ undeclared here` at GCC pass if `const crash = # true`. I am aware that this is a const+closure problem, but I guess it should # error out at Nim pass, not GCC. Tested with 2.0.2, 2.0.0, 1.6.14 # Do you think this should be posted as github issue? import prologue proc myclosure(dest: string): HandlerAsync = result = proc(ctx: Context) {.async.} = resp redirect(dest) var app = newApp() const crash = true when crash: const urlPatterns = @[pattern("/favicon.ico", myclosure("/static/favicon.ico"))] app.addRoute(urlPatterns, "") else: app.addRoute(@[pattern("/favicon.ico", myclosure("/static/favicon.ico"))], "") app.run()