rbwhitaker / CSharpPlayersGuideEarlyAccess

A place to track issues with the C# Player's Guide for patches and future editions
19 stars 0 forks source link

[DarkShinryu on Discord] text += Math.PI; actually runs when the book says it won't #622

Closed rbwhitaker closed 2 years ago

rbwhitaker commented 2 years ago

In the discussion on dynamic type checking, I used the example text += Math.PI; and indicated it would throw an exception. Alas, it does not, because += is actually defined for strings and a double. So this should maybe just be changed to *= instead.

rbwhitaker commented 2 years ago

Changed to -= instead of the original += or the *= that was suggested in the original description. There is already a *= in the list of things that fail, so I didn't want two of them.