Skip to content

Commit 6fb80e4

Browse files
committed
Updated after review
1 parent 968a26c commit 6fb80e4

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/LightupHelpers.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ namespace StyleCop.Analyzers.Lightup
1313

1414
internal static class LightupHelpers
1515
{
16-
private const string WrappedTypePropertyName = "WrappedType";
17-
1816
private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>> SupportedWrappers
1917
= new ConcurrentDictionary<Type, ConcurrentDictionary<SyntaxKind, bool>>();
2018

@@ -295,16 +293,8 @@ internal static Func<TSyntax, SeparatedSyntaxListWrapper<TProperty>, TSyntax> Cr
295293

296294
private static bool ValidatePropertyType(Type returnType, Type actualType)
297295
{
298-
if (returnType.GetTypeInfo().ImplementedInterfaces.Any(t => t.GetGenericTypeDefinition() == typeof(ISyntaxWrapper<>)))
299-
{
300-
// The requested property is a wrapper type, so validate against the wrapped type.
301-
var wrappedType = WrapperHelper.GetWrappedType(returnType);
302-
return wrappedType == actualType;
303-
}
304-
else
305-
{
306-
return returnType == actualType;
307-
}
296+
var requiredType = WrapperHelper.GetWrappedType(returnType) ?? returnType;
297+
return requiredType == actualType;
308298
}
309299
}
310300
}

0 commit comments

Comments
 (0)