From 61e310449a719453950ecb04878c27e9e6a41600 Mon Sep 17 00:00:00 2001 From: James Groom Date: Thu, 16 Mar 2023 11:13:05 +1000 Subject: [PATCH] Updated C# and .NET docs supplement (markdown) --- C#-and-.NET-docs-supplement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C#-and-.NET-docs-supplement.md b/C#-and-.NET-docs-supplement.md index 3dad8b4..f21013e 100644 --- a/C#-and-.NET-docs-supplement.md +++ b/C#-and-.NET-docs-supplement.md @@ -45,7 +45,7 @@ Notice also the default window icon (`Form.Icon`): on Windows, it's a distinct i There are two types of casts in C#: the C-style `(T) o` throws if the object is not of the desired type, whereas `o as T` evaluates to `null` if it's not of the desired type. There's no '?' in this `null`-producing operator (this is probably only confusing if you use Kotlin). -If an object being the wrong type is *exceptional*—the method can't handle it gracefully—then throw an *exception* straight away. Having it reported as an NRE when there's no `null` in sight just delays debugging the problem. +If an object being the wrong type is *exceptional*—the method can't handle it gracefully—then throw a type cast *exception* straight away. Having it reported as an NRE when there's no `null` in sight just frustrates debugging efforts. ## Type constraints (`where` clauses)