Skip to content

Commit 2006025

Browse files
authored
Fix return type diagnostic conditions (#30)
1 parent cd06055 commit 2006025

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ServiceScan.SourceGenerator/DependencyInjectionGenerator.ParseMethodModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public partial class DependencyInjectionGenerator
8484
}
8585
else
8686
{
87-
if (method.IsExtensionMethod && !method.ReturnsVoid &&
87+
if (!method.ReturnsVoid &&
8888
(method.Parameters.Length == 0 || !SymbolEqualityComparer.Default.Equals(method.Parameters[0].Type, method.ReturnType)))
8989
{
9090
return Diagnostic.Create(WrongReturnTypeForCustomHandler, method.Locations[0]);

ServiceScan.SourceGenerator/DiagnosticDescriptors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static class DiagnosticDescriptors
5555

5656
public static readonly DiagnosticDescriptor WrongReturnTypeForCustomHandler = new("DI0009",
5757
"Wrong return type",
58-
"Method with CustomHandler must return void or 'this' parameter type",
58+
"Method with CustomHandler must return void or the type of its first parameter",
5959
"Usage",
6060
DiagnosticSeverity.Error,
6161
true);

0 commit comments

Comments
 (0)