From cb47ec3fb2ddda9e1edda18eb944d51bd6105e43 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:45:45 +0000 Subject: [PATCH 01/13] Initial plan From 28794f3e495b222ce6a6714ca065fb9f5364cf52 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:48:19 +0000 Subject: [PATCH 02/13] Clarify CS0112 behavior for C# 11 interface static members Agent-Logs-Url: https://github.com/dotnet/docs/sessions/575e2a27-b97e-4b8f-91a4-d0ccbb63de4b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 9b42dd1f0e1bb..eb1188adc90db 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -10,9 +10,11 @@ ms.assetid: 6741c7c4-8553-4bbe-b950-4f908e8d9ba3 --- # Compiler Error CS0112 -A static member 'function' cannot be marked as override, virtual or abstract +A static member 'function' in a class or struct cannot be marked as override, virtual, or abstract. - Any method declaration that uses the `override`, **virtual**, or **abstract** keyword cannot also use the **static** keyword. +Any method declaration in a class or struct that uses the `override`, **virtual**, or **abstract** keyword can't also use the **static** keyword. + +Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From 28e10828e6ab940f48e0e9991745432d0e8dcff1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:48:48 +0000 Subject: [PATCH 03/13] Apply style contraction in CS0112 description Agent-Logs-Url: https://github.com/dotnet/docs/sessions/575e2a27-b97e-4b8f-91a4-d0ccbb63de4b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index eb1188adc90db..6de9762a767d6 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -10,7 +10,7 @@ ms.assetid: 6741c7c4-8553-4bbe-b950-4f908e8d9ba3 --- # Compiler Error CS0112 -A static member 'function' in a class or struct cannot be marked as override, virtual, or abstract. +A static member 'function' in a class or struct can't be marked as override, virtual, or abstract. Any method declaration in a class or struct that uses the `override`, **virtual**, or **abstract** keyword can't also use the **static** keyword. From 3f45ac490c86eabfabea8d12486938a7c728a315 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:49:31 +0000 Subject: [PATCH 04/13] Use formal wording in CS0112 description Agent-Logs-Url: https://github.com/dotnet/docs/sessions/575e2a27-b97e-4b8f-91a4-d0ccbb63de4b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 6de9762a767d6..244032ea5b1af 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -10,9 +10,9 @@ ms.assetid: 6741c7c4-8553-4bbe-b950-4f908e8d9ba3 --- # Compiler Error CS0112 -A static member 'function' in a class or struct can't be marked as override, virtual, or abstract. +A static member 'function' in a class or struct cannot be marked as override, virtual, or abstract. -Any method declaration in a class or struct that uses the `override`, **virtual**, or **abstract** keyword can't also use the **static** keyword. +Any method declaration in a class or struct that uses the `override`, **virtual**, or **abstract** keyword cannot also use the **static** keyword. Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. From 189627042651f8804ef04ef8579fcd5217f68b0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 17:50:26 +0000 Subject: [PATCH 05/13] Normalize keyword formatting in CS0112 guidance Agent-Logs-Url: https://github.com/dotnet/docs/sessions/575e2a27-b97e-4b8f-91a4-d0ccbb63de4b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 244032ea5b1af..0bd42f57c310f 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -12,7 +12,7 @@ ms.assetid: 6741c7c4-8553-4bbe-b950-4f908e8d9ba3 A static member 'function' in a class or struct cannot be marked as override, virtual, or abstract. -Any method declaration in a class or struct that uses the `override`, **virtual**, or **abstract** keyword cannot also use the **static** keyword. +Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. From 52a7507ac294c448d1a6ecf111aa79cc48bdad18 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:03:52 +0000 Subject: [PATCH 06/13] Add pre-C#11 interface constraint to CS0112 doc Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 0bd42f57c310f..0de85f345c1af 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,6 +14,8 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. +Before C# 11, interface members couldn't use `static` with `override`, `virtual`, or `abstract`. + Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From bc79eff7f501a658aa75da626b16991235e397c2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:04:34 +0000 Subject: [PATCH 07/13] Use formal wording for pre-C#11 note in CS0112 Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 0de85f345c1af..4aadf405a2411 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,7 +14,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members couldn't use `static` with `override`, `virtual`, or `abstract`. +Before C# 11, interface members could not use `static` with `override`, `virtual`, or `abstract`. Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. From f5b05662d92d6d763ed5e7a7f1760dcd8aec7345 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:05:10 +0000 Subject: [PATCH 08/13] Clarify pre-C#11 and C#11 interface modifier behavior in one sentence Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 4aadf405a2411..e073811cb2dae 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,9 +14,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members could not use `static` with `override`, `virtual`, or `abstract`. - -Starting in C# 11, interface methods, properties, events, and operators can use `static abstract` or `static virtual`. +Before C# 11, interface members couldn't combine `static` with `override`, `virtual`, or `abstract`; C# 11 lifted that restriction for interface methods, properties, events, and operators declared as `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From 33eda7324e1e3babc42a323ea2473ac135b7a892 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:05:50 +0000 Subject: [PATCH 09/13] Split C#11 transition note into two sentences for clarity Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index e073811cb2dae..98e084fa879bb 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,7 +14,8 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members couldn't combine `static` with `override`, `virtual`, or `abstract`; C# 11 lifted that restriction for interface methods, properties, events, and operators declared as `static abstract` or `static virtual`. +Before C# 11, interface members couldn't combine `static` with `override`, `virtual`, or `abstract`. +C# 11 lifted that restriction for interface methods, properties, events, and operators declared as `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From 5bf56d96548c8c9156a843a1995044ac91058640 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:06:38 +0000 Subject: [PATCH 10/13] Use formal verb form in pre-C#11 CS0112 note Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 98e084fa879bb..60bc92c9f8dcb 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,7 +14,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members couldn't combine `static` with `override`, `virtual`, or `abstract`. +Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. C# 11 lifted that restriction for interface methods, properties, events, and operators declared as `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From fd9d42094473f95a37b41c47c35dd51d426eb7a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:07:10 +0000 Subject: [PATCH 11/13] Make C#11 exception wording explicit in CS0112 article Agent-Logs-Url: https://github.com/dotnet/docs/sessions/144c5760-2105-4bac-9d18-3ba843bb7a2b Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 60bc92c9f8dcb..fc5d573a78734 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -15,7 +15,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. -C# 11 lifted that restriction for interface methods, properties, events, and operators declared as `static abstract` or `static virtual`. +In C# 11, interface methods, properties, events, and operators can combine `static` with `abstract` or `virtual` by using `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From 0e233917ea704f37764cfce64422277cd8f8141e Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Wed, 15 Apr 2026 14:10:47 -0400 Subject: [PATCH 12/13] Apply suggestions from code review Co-authored-by: Bill Wagner --- docs/csharp/misc/cs0112.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index fc5d573a78734..658e8adcef69e 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,8 +14,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. -In C# 11, interface methods, properties, events, and operators can combine `static` with `abstract` or `virtual` by using `static abstract` or `static virtual`. +Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. Beginning C# 11, interface methods, properties, events, and operators can combine `static` with `abstract` or `virtual` by using `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md). From f0aa784b739a24fa931318dd13bdcef142e0b67e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 15 Apr 2026 18:18:21 +0000 Subject: [PATCH 13/13] Fix CS0112 C# 11 transition grammar Agent-Logs-Url: https://github.com/dotnet/docs/sessions/2c459477-12a9-4963-a7dd-1fac093fbd5e Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/misc/cs0112.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/misc/cs0112.md b/docs/csharp/misc/cs0112.md index 658e8adcef69e..b201835a560ed 100644 --- a/docs/csharp/misc/cs0112.md +++ b/docs/csharp/misc/cs0112.md @@ -14,7 +14,7 @@ A static member 'function' in a class or struct cannot be marked as override, vi Any method declaration in a class or struct that uses the `override`, `virtual`, or `abstract` keyword cannot also use the `static` keyword. -Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. Beginning C# 11, interface methods, properties, events, and operators can combine `static` with `abstract` or `virtual` by using `static abstract` or `static virtual`. +Before C# 11, interface members could not combine `static` with `override`, `virtual`, or `abstract`. Beginning with C# 11, interface methods, properties, events, and operators can combine `static` with `abstract` or `virtual` by using `static abstract` or `static virtual`. For more information, see [Methods](../programming-guide/classes-and-structs/methods.md).