Closed mtshiba closed 2 years ago
This issue was not reproduced in release builds or on Unix-family OSs. Apparently Windows allocates a small stack size to executables by default.
Or perhaps the current parser process should be renovated to be more efficient.
I have researched this issue a bit.
The following files cause overflow.
Looking at where the overflow is occurring, it occurs in braces.
ex)
Point = Class {x = Int|-> overflow
Point2D = Class {x|-> overflow
LitExpr = Class {.i = Int|-> overflow
Nil T = Class Impl := Phantom(|-> overflow
So I tried to see how far nesting would cause overflow, and it occurs at 25 times or more.
At the 25th time, it takes almost 1-2 minutes before the result is displayed.
r = (1, (2, (3, (4, (5, (6, (7, (8, (9, (10, (11, (12, (13, (14, (15, (16, (17, (18, (19, (20, (21, (22, (23, (24, 25))))))))))))))))))))))))
print! r
Or perhaps the current parser process should be renovated to be more efficient.
I agree with this opinion.
Reproducible code
Result A stack overflow occurs.
OS Windows 11
First-aid treatment
If you run the above command, a stack overflow will not happen.