dotnet / dotnet/fsharp

Cubic/Exponential compilation time for very large anonymous record

Open
#11,638 7 comments 3 reactions 0 assignees View on GitHub
Area-Compiler-PatternMatching Bug Impact-Medium
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

See current repro at end of issue

----------------
**Repro steps**

1. Open Program.fs in [LargeArrayRepro.zip](https://github.com/dotnet/fsharp/files/6602731/LargeArrayRepro.zip).
It contains a large array of constants.

2. Try typing `let vector =` at the beginning and you will get a Stack Overflow in Rider and Visual Studio (16.10)

![image](https://user-images.githubusercontent.com/26364714/120896122-c7528e80-c628-11eb-99ae-e94e6109a876.png)

This is probably because the array is treated as a pattern before you write ``=``
Stacktrace demonstrates multiple recursive calls leading to an overflow.

![image](https://user-images.githubusercontent.com/26364714/120896079-8ce8f180-c628-11eb-848f-60012d8dd8fc.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.