Skip to content

Commit 92766c1

Browse files
author
Andrew Mansell
committed
Fixed assert
1 parent ccaa7f5 commit 92766c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Rubberduck.VBEEditor/Utility/EnumHelper.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ public static Dictionary<TUnderlying, string> ToDictionary<TEnum, TUnderlying>()
1111
{
1212
var enumType = typeof(TEnum);
1313
var underlyingType = typeof(TUnderlying);
14+
var actualUnderlyingType = Enum.GetUnderlyingType(enumType);
1415

1516
Debug.Assert(enumType.IsEnum, $"Type '{enumType.Name}' is not an enum");
16-
17-
Debug.Assert(Enum.GetUnderlyingType(enumType) == underlyingType,
18-
$"Type parameter '{underlyingType}' does not match underlying type for enum '{enumType.Name}' ('{Enum.GetUnderlyingType(enumType).Name}')");
17+
Debug.Assert(actualUnderlyingType == underlyingType, $"Underlying type parameter '{underlyingType.Name}' does not match actual underlying type for enum '{enumType.Name}' ('{actualUnderlyingType.Name}')");
1918

2019
var dictionary = new Dictionary<TUnderlying, string>();
2120

0 commit comments

Comments
 (0)