From 9b57f629358176da50e6081b8a4162e06dd923dc Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Sun, 17 Nov 2024 12:07:28 -0500 Subject: [PATCH 1/3] fix grammar and add constraint --- standard/classes.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/standard/classes.md b/standard/classes.md index 6252dfe25..ce1f8ad37 100644 --- a/standard/classes.md +++ b/standard/classes.md @@ -2130,7 +2130,7 @@ default_argument parameter_modifier : parameter_mode_modifier - | 'this' + | 'this' parameter_mode_modifier? ; parameter_mode_modifier @@ -3056,6 +3056,7 @@ When the first parameter of a method includes the `this` modifier, that method i - It may only be an input parameter if it has a value type - It may only be a reference parameter if it has a value type or has a generic type constrained to struct +- It shall not be an output parameter. - It shall not be a pointer type. > *Example*: The following is an example of a static class that declares two extension methods: From 9dff369a22eaec283cd8e1f3a292d4d3af12d0ed Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Thu, 29 May 2025 16:48:54 -0400 Subject: [PATCH 2/3] allow both modifier orders Co-authored-by: Nigel-Ecma <6654683+Nigel-Ecma@users.noreply.github.com> --- standard/classes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/standard/classes.md b/standard/classes.md index ce1f8ad37..227dfede7 100644 --- a/standard/classes.md +++ b/standard/classes.md @@ -2131,6 +2131,7 @@ default_argument parameter_modifier : parameter_mode_modifier | 'this' parameter_mode_modifier? + | parameter_mode_modifier? 'this' ; parameter_mode_modifier From 75a3f902e0b10dbe8110dcd6b8b8762ae991a9c8 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Thu, 29 May 2025 17:11:17 -0400 Subject: [PATCH 3/3] add punctuation --- standard/classes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard/classes.md b/standard/classes.md index 227dfede7..0728e0997 100644 --- a/standard/classes.md +++ b/standard/classes.md @@ -3055,8 +3055,8 @@ class Customer When the first parameter of a method includes the `this` modifier, that method is said to be an ***extension method***. Extension methods shall only be declared in non-generic, non-nested static classes. The first parameter of an extension method is restricted, as follows: -- It may only be an input parameter if it has a value type -- It may only be a reference parameter if it has a value type or has a generic type constrained to struct +- It may only be an input parameter if it has a value type. +- It may only be a reference parameter if it has a value type or has a generic type constrained to struct. - It shall not be an output parameter. - It shall not be a pointer type.