dotnet / dotnet/fsharp

Problem with a record with hundreds of members - StackOverflow

Open
#11,114 13 comments 0 reactions 0 assignees View on GitHub
Area-Compiler-CodeGen Feature Improvement
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

While working with a some code generated from the [Facil](https://github.com/cmeeren/Facil/) library I got a stack overflow on a very wide table which create a record with a lot of members.

When the exception is thrown the call stack isn’t that full.

![image](https://user-images.githubusercontent.com/1804141/108081143-87ab6b00-7068-11eb-8bb0-69d1d4521533.png)

After some more investigation, I’ve worked it out it was the part of the code that constructs the record class which contains lots of database null checking.

(This is from dotpeek)

![image](https://user-images.githubusercontent.com/1804141/108081316-bcb7bd80-7068-11eb-80b2-90383d047e92.png)

This has been documented on https://github.com/cmeeren/Facil/issues/9 but we could really do with some help working out why and how to avoid this as this seem to be a problem with the F# complier creating code that can't be executed.

Provide any related information (optional):

* Windows 10
* net5.0

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.