What does “DisplayClass” name mean when calling lambda?

From an answer to a related question by Eric Lippert:

The reason that a closure class is called “DisplayClass” is a bit unfortunate: this is jargon used by the debugger team to describe a class that has special behaviours when displayed in the debugger. Obviously we do not want to display “x” as a field of an impossibly-named class when you are debugging your code; rather, you want it to look like any other local variable. There is special gear in the debugger to handle doing so for this kind of display class. It probably should have been called “ClosureClass” instead, to make it easier to read disassembly.

Leave a Comment