effekt-lang / effekt

A research language with effect handlers and lightweight effect polymorphism
https://effekt-lang.org
MIT License
304 stars 14 forks source link

Renamer stack-overflows on large test suites #517

Open marzipankaiser opened 2 weeks ago

marzipankaiser commented 2 weeks ago

When writing large test suites using the test stdlib, Renamer reaches a stack overflow. (With even larger test suites, doubling the number of tests in the example below, Namer will stack overflow.)

Reproducing the issue

Test suite that triggers a stack overflow in Renamer for me:

import test

def main() = {
  suite("Testsuite") {
    test("A test") { assert(1,1) } // repeated 500 times
  }
}

https://gist.github.com/marzipankaiser/407983d6cb012e11c03753afeb464bed

I have not, as of yet, managed to reproduce the issue with simplified higher-order functions (not from the test stdlib), but I would assume it's possible.

Expected behavior

I would expect a long (not highly nested) program to compile normally.

marzipankaiser commented 2 weeks ago

I'm not sure if we want to fix this, but at least wanted to document it, since @sideburns3000 ran into it. There is a simple workaround, though (split the test suite into multiple smaller ones or shrink it to fewer tests).