From 0bdaac5b215c2812435ca85944110695e855f4f5 Mon Sep 17 00:00:00 2001 From: Daniil Zaycev Date: Mon, 16 Sep 2024 23:17:04 +0300 Subject: [PATCH] Feature/refactoring (#24) * some small refactoring * feat: remove primary ctor's --- .../Utils/TypeChecking/DeclaredTypeSymbolChecker.cs | 10 ++++++++-- .../Utils/TypeChecking/RecursiveTypeSymbolChecker.cs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/DeclaredTypeSymbolChecker.cs b/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/DeclaredTypeSymbolChecker.cs index 0846d3e..2292ffb 100644 --- a/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/DeclaredTypeSymbolChecker.cs +++ b/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/DeclaredTypeSymbolChecker.cs @@ -6,9 +6,15 @@ namespace ImmutableAnalyzer.Utils.TypeChecking; /// /// Checks for immutability by declared types. /// -internal class DeclaredTypeSymbolChecker(TypeChecker? inner = null) : TypeChecker +internal class DeclaredTypeSymbolChecker : TypeChecker { - private readonly TypeChecker? _inner = inner; + private readonly TypeChecker? _inner; + + /// + /// Creates new instance of . + /// + /// Inner checker. + public DeclaredTypeSymbolChecker(TypeChecker? inner = null) { _inner = inner; } /// public override bool IsImmutable(ITypeSymbol typeSymbol) diff --git a/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/RecursiveTypeSymbolChecker.cs b/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/RecursiveTypeSymbolChecker.cs index 31eb6ae..4e729b6 100644 --- a/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/RecursiveTypeSymbolChecker.cs +++ b/src/ImmutableAnalyzer/ImmutableAnalyzer/Utils/TypeChecking/RecursiveTypeSymbolChecker.cs @@ -6,9 +6,15 @@ namespace ImmutableAnalyzer.Utils.TypeChecking; /// /// Decorator to check recursively. /// -internal class RecursiveTypeSymbolChecker(TypeChecker inner) : TypeChecker +internal class RecursiveTypeSymbolChecker : TypeChecker { - private readonly TypeChecker _inner = inner; + private readonly TypeChecker _inner; + + /// + /// Creates new instance of . + /// + /// Inner checker. + public RecursiveTypeSymbolChecker(TypeChecker inner) { _inner = inner; } /// public override bool IsImmutable(ITypeSymbol typeSymbol)