From dfde6f6a53cc8bedae994e75471e6cc05f8743f9 Mon Sep 17 00:00:00 2001 From: Kevin Bost Date: Thu, 25 Jan 2024 00:21:32 -0800 Subject: [PATCH] Removing caching of symbol --- Moq.AutoMocker.TestGenerator/GeneratorTargetClass.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Moq.AutoMocker.TestGenerator/GeneratorTargetClass.cs b/Moq.AutoMocker.TestGenerator/GeneratorTargetClass.cs index a62e6a9..40f2ffa 100644 --- a/Moq.AutoMocker.TestGenerator/GeneratorTargetClass.cs +++ b/Moq.AutoMocker.TestGenerator/GeneratorTargetClass.cs @@ -33,7 +33,10 @@ public class Parameter { public Parameter(IParameterSymbol symbol) { - Symbol = symbol; + Name = symbol.Name; + ParameterType = symbol.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + IsValueType = symbol.Type.IsValueType; + if (symbol.HasExplicitDefaultValue) { IsNullable = symbol.ExplicitDefaultValue is null; @@ -42,13 +45,10 @@ public Parameter(IParameterSymbol symbol) { IsNullable = true; } - - IsValueType = symbol.Type.IsValueType; } - private IParameterSymbol Symbol { get; } public bool IsValueType { get; } public bool IsNullable { get; } - public string Name => Symbol.Name; - public string ParameterType => Symbol.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + public string Name { get; } + public string ParameterType { get; } }