This is an automated email from the ASF dual-hosted git repository.

FreeAndNil pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4net.git


The following commit(s) were added to refs/heads/master by this push:
     new 839191e7 documented "Omit the type wherever the target is known"
839191e7 is described below

commit 839191e777ddd0f0729794ace06272ad670ba221
Author: Jan Friedrich <[email protected]>
AuthorDate: Tue Jul 28 22:35:34 2026 +0200

    documented "Omit the type wherever the target is known"
---
 CLAUDE.md | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CLAUDE.md b/CLAUDE.md
index 7d1cd10c..b7cb7994 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -33,6 +33,9 @@ almost always be doing.
 - **Explicit types, not `var`** — all three `csharp_style_var_*` options are 
`false`.
   Write `StringWriter writer = new(...)`.
 - Target-typed `new()` and collection expressions (`private static readonly 
char[] _x = [',', ';'];`).
+  Omit the type wherever the target is known — including `return new(…);` and 
`=> new(…);`, where
+  the enclosing member's return type supplies it. It cannot be omitted when 
the target type is an
+  interface or abstract class, as in `Func<ISmtpTransport> f = () => new 
MailKitSmtpTransport();`.
 - Expression-bodied members whenever the body fits on one line — this includes 
constructors
   (`resharper_constructor_or_destructor_body = expression_body`).
 - Braces on `if`/`else` bodies even for a single statement.

Reply via email to