From 1c7cde5d3b9ec31d3a18c0a50e44efb3df7ba7b9 Mon Sep 17 00:00:00 2001 From: hadashiA Date: Mon, 23 Dec 2024 15:49:22 +0900 Subject: [PATCH] Fix incorrect setter validation --- VContainer.SourceGenerator/Emitter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/VContainer.SourceGenerator/Emitter.cs b/VContainer.SourceGenerator/Emitter.cs index da810017..dfe52f54 100644 --- a/VContainer.SourceGenerator/Emitter.cs +++ b/VContainer.SourceGenerator/Emitter.cs @@ -132,7 +132,9 @@ static bool TryEmitInjectMethod( // verify property foreach (var propSymbol in typeMeta.InjectProperties) { - if (propSymbol.SetMethod == null || !propSymbol.SetMethod.IsInitOnly || !propSymbol.SetMethod.CanBeCallFromInternal()) + if (propSymbol.SetMethod == null || + propSymbol.SetMethod.IsInitOnly || + !propSymbol.SetMethod.CanBeCallFromInternal()) { context.ReportDiagnostic(Diagnostic.Create( DiagnosticDescriptors.PrivatePropertyNotSupported,