From f02ba60bfa39be4a4cf82a6cc72c6ed25e7df476 Mon Sep 17 00:00:00 2001 From: vegorov-rbx <75688451+vegorov-rbx@users.noreply.github.com> Date: Tue, 8 Jun 2021 21:56:20 +0300 Subject: [PATCH] Apply suggestions from review Co-authored-by: Alexander McCord <11488393+alexmccord@users.noreply.github.com> --- rfcs/syntax-nil-forgiving-operator.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rfcs/syntax-nil-forgiving-operator.md b/rfcs/syntax-nil-forgiving-operator.md index c8c0c419..7784ee17 100644 --- a/rfcs/syntax-nil-forgiving-operator.md +++ b/rfcs/syntax-nil-forgiving-operator.md @@ -16,7 +16,7 @@ local p = a!.b!.c ``` instead of ```lua -local ((p as Part).b as Folder).c +local ((p :: Part).b :: Folder).c ``` Note that nil-forgiving operator is **not** a part of member access operator, it can be used in standalone expressions, indexing and other places: @@ -25,7 +25,7 @@ local p = f(a!)! local q = b!['X'] ``` -Nil-forgiving operator (also known as null-forgiving or null-suppression operator) can be found in C# programming language. +Nil-forgiving operator (also known as null-forgiving or null-suppression operator) can be found in some programming languages such as C# and TypeScript. ## Design @@ -80,7 +80,7 @@ Because nil-chaining has a run-time check it can only be used in specific expres Multiple cases will be defined: * ?. nil-chaining member access operator. If LHS is `nil`, member access is not performed and the expression value is `nil`. The type of this expressions is a union between member type and `nil`. -* ?[] nil-chaining indexing operator. If LSH is `nil`, index access is not performed and the expression value is `nil`. Type of the expression is a union between element type and `nil`. -* ?() nil-chaining function call operator. If LSH is `nil`, function is not called and the expression value is `nil`. Type of the expression is a union between function return type and `nil`. +* ?[] nil-chaining indexing operator. If LHS is `nil`, index access is not performed and the expression value is `nil`. Type of the expression is a union between element type and `nil`. +* ?() nil-chaining function call operator. If LHS is `nil`, function is not called and the expression value is `nil`. Type of the expression is a union between function return type and `nil`. nil-chaining operator can be found in many programming languages, including C#, Dart, Kotlin, Swift and TypeScript.