Skip to contentSkip to conversation

Add support for C# record types

PATCH In review Julian Verdurmen via GitGitGadget 2 participants 2 messages Mar 2, 2021 – Jun 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for C# record types

From: Julian Verdurmen <[email protected]>

Records are added in C# 9

Code example :

    public record Person(string FirstName, string LastName);

For more information, see:
* https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9

---
userdiff.c: Added support for record types in C#

Support for C# 9 records. See
https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/exploration/records

I will try to use gitgitgadget [https://gitgitgadget.github.io/]

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-971%2F304NotModified%2Fcsharp-record-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-971/304NotModified/csharp-record-v1
Pull-Request: https://github.com/git/git/pull/971

 userdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
userdiff.c +1 -1
index 3f81a2261c5e..2803683c3117 100644
@@ -212,7 +212,7 @@ PATTERNS("csharp",
 	 /* Properties */
 	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
 	 /* Type definitions */
-	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
+	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct|record)[ \t]+.*)$\n"
 	 /* Namespace */
 	 "^[ \t]*(namespace[ \t]+.*)$",
 	 /* -- */

base-commit: 328c10930387d301560f7cbcd3351cc485a13381

Signature · 1 line
gitgitgadget
Reviewed-by on v1 1/1
#1 lore raw

Hi Julian,

Quoted 4 lines · Julian Verdurmen via GitGitGadget

From: Julian Verdurmen <[email protected]>

Records are added in C# 9

Quoted 8 lines

Code example :

    public record Person(string FirstName, string LastName);

For more information, see:
* https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9

I am not precisely a C# _expert_, but from what I understand this patch and commit message look good to me.

Thanks,
Dscho

Quoted 34 lines

---
userdiff.c: Added support for record types in C#

Support for C# 9 records. See
https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/exploration/records

I will try to use gitgitgadget [https://gitgitgadget.github.io/]

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-971%2F304NotModified%2Fcsharp-record-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-971/304NotModified/csharp-record-v1
Pull-Request: https://github.com/git/git/pull/971

 userdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
userdiff.c +1 -1
index 3f81a2261c5e..2803683c3117 100644
@@ -212,7 +212,7 @@ PATTERNS("csharp",
 	 /* Properties */
 	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
 	 /* Type definitions */
-	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
+	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct|record)[ \t]+.*)$\n"
 	 /* Namespace */
 	 "^[ \t]*(namespace[ \t]+.*)$",
 	 /* -- */

base-commit: 328c10930387d301560f7cbcd3351cc485a13381 --
gitgitgadget