Skip to content

Commit

Permalink
Merge branch 'releases/7.x.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelGerr committed Sep 27, 2024
2 parents 1075911 + 6c26b5e commit f51e116
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static void AnalyzeSmartEnum(OperationAnalysisContext context)
{
context.ReportDiagnostic(Diagnostic.Create(DiagnosticsDescriptors.ErrorDuringCodeAnalysis,
Location.None,
type.ToFullyQualifiedDisplayString(), ex.Message));
type.ToFullyQualifiedDisplayString(), ex.ToString()));
}
}

Expand Down Expand Up @@ -274,7 +274,7 @@ private static void AnalyzeValueObject(OperationAnalysisContext context)
{
context.ReportDiagnostic(Diagnostic.Create(DiagnosticsDescriptors.ErrorDuringCodeAnalysis,
Location.None,
type.ToFullyQualifiedDisplayString(), ex.Message));
type.ToFullyQualifiedDisplayString(), ex.ToString()));
}
}

Expand Down Expand Up @@ -302,7 +302,7 @@ private static void AnalyzeUnion(OperationAnalysisContext context)
{
context.ReportDiagnostic(Diagnostic.Create(DiagnosticsDescriptors.ErrorDuringCodeAnalysis,
Location.None,
type.ToFullyQualifiedDisplayString(), ex.Message));
type.ToFullyQualifiedDisplayString(), ex.ToString()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public ITypedMemberState Create(ITypeSymbol type)
SpecialType.System_Double => _double,
SpecialType.System_String => _string,
SpecialType.System_DateTime => _dateTime,
_ => _statesByTokens.TryGetValue((type.ContainingModule.MetadataName, type.MetadataToken), out var states) ? states : default
// Array types have no ContainingModule
_ => _statesByTokens.TryGetValue((type.ContainingModule?.MetadataName ?? "<<no module>>", type.MetadataToken), out var states) ? states : default
};

if (cachedStates == default)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Thinktecture.Runtime.Tests.TestEnums;

[SmartEnum<int>]
public partial class TestEnumWithArrayType
{
private static readonly TestEnumWithArrayType[] InternalMaritalStatusWithPartner = [];

public static readonly TestEnumWithArrayType Item = new(1);
}

0 comments on commit f51e116

Please sign in to comment.