Home

Wrong? behavior for example - Calculated Property - alternative

edited May 2022

Hi,

(Using LINQPad 7.3.9 (x64) on a Windows 11)

I added the What's New in C# 9 - The Best Parts (webcast) samples and when running the Using Records - Calculated property - alternate the output is as expected:

However if I step through the code using F11, at the moment I enter the constructor, the value for _distance is 0:

and this causes the output to be wrong. If I keep stepping (F11) through the code the output shows 2 times a zero:

What is going on here?

Sign In or Register to comment.