Home

Bug Linqpad 6, stackoverflow exception on dumping record with linkedlist style properties

edited November 2021

SystemInfo

Host runtime version: 3.1.21
Default query runtime version: 5.0.12
Default query reference assembly version: 5.0.0
Roslyn Version: 3.9.0-6.21124.20
FSharp.Compiler.Service version: 39.0.0.0
NuGet client version: 5.10.0.7240
Results rendering engine: Edge Chromium Engine 95.0.1020.53

Problem

Dumping the record results in a stackoverflow exception.

Example

http://share.linqpad.net/ap2qkq.linq

Thanks for your great program.

Comments

  • I'll change the way records are dumped in the next LINQPad build so that it doesn't call ToString() on them (as this is unnecessary). This will let you dump the records, but you may still run into a stack overflow in other scenarios (including outside LINQPad) because it's the compiler-generated ToString() method that's causing the stack overflow.

    You can fix this by overriding ToString() on the record.

  • Yes, that fixes it. Thanks

Sign In or Register to comment.