From 0bf015e53f5f90f91ea236f5f0c257bc5616f45f Mon Sep 17 00:00:00 2001 From: James Groom Date: Wed, 8 Feb 2023 03:41:43 +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 c115d3c..e42bdd5 100644 --- a/C#-and-.NET-docs-supplement.md +++ b/C#-and-.NET-docs-supplement.md @@ -20,7 +20,7 @@ see [feature matrix](https://github.com/TASEmulators/BizHawk/wiki/Available-C%23 ## Type casting -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.) +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*, throw an *exception* straight away. Having it reported as an NRE when there's no `null` in sight just delays debugging the problem.