Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long refmt run time with a stack overflow on a file with a bunch of modules #2594

Open
Lupus opened this issue Jun 18, 2020 · 1 comment
Open
Labels
Printer things that have to do with turning an AST into Reason code

Comments

@Lupus
Copy link

Lupus commented Jun 18, 2020

I've distilled my file down to the following snippet:

module M1 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

module M6 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

module M5 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

module M4 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

module M3 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

module M2 = {
  include X({
    let r = x => {z: s => s};
  });
  let f = (m, x) => x;
  let f_z = (m, x) => x;
  let g = {z: s => s};
  let u = s => {z: s => s};
};

Which still demonstrates the problem:

$ time refmt --print=binary refmt-repro.re > /dev/null
Stack overflow

real    0m17.570s
user    0m17.173s
sys     0m0.395s

Environment info:

There is similar issue #2190 but looks like it's caused by different pattern of code.

@davesnx davesnx added the Printer things that have to do with turning an AST into Reason code label Nov 21, 2022
@anmonteiro
Copy link
Member

doesn't stack overflow anymore, but might be because I'm testing on 5.x which has unlimited stack size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Printer things that have to do with turning an AST into Reason code
Projects
None yet
Development

No branches or pull requests

3 participants