File tree Expand file tree Collapse file tree
YamlDotNet.Analyzers.StaticGenerator Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,7 +176,14 @@ public override void Write(SerializableSyntaxReceiver syntaxReceiver)
176176 foreach ( var o in syntaxReceiver . Classes )
177177 {
178178 var classObject = o . Value ;
179- if ( classObject . ModuleSymbol . GetMembers ( "Parse" ) . OfType < IMethodSymbol > ( ) . Any ( m => m . IsStatic && m . Parameters . Length == 1 && m . Parameters [ 0 ] . Type . SpecialType == SpecialType . System_String ) )
179+ if ( classObject . ModuleSymbol
180+ . GetMembers ( "Parse" )
181+ . OfType < IMethodSymbol > ( )
182+ . Any ( m => m . DeclaredAccessibility == Accessibility . Public &&
183+ m . IsStatic &&
184+ m . Parameters . Length == 1 &&
185+ m . Parameters [ 0 ] . Type . SpecialType == SpecialType . System_String &&
186+ SymbolEqualityComparer . Default . Equals ( m . ReturnType , classObject . ModuleSymbol ) ) )
180187 {
181188 Write ( $ "if (expectedType == typeof({ classObject . ModuleSymbol . GetFullName ( ) . Replace ( "?" , string . Empty ) } ))") ;
182189 Write ( "{" ) ; Indent ( ) ;
You can’t perform that action at this time.
0 commit comments