Skip to content

Commit 8f6bd34

Browse files
committed
fix coreclr isabstract lookup
1 parent 3c184b7 commit 8f6bd34

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Tests/CodeStandards/NamingConventions.doc.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ [U] public void ClassNameContainsBaseShouldBeAbstract()
3535
var baseClassesNotAbstract = typeof(IRequest).Assembly().GetTypes()
3636
.Where(t => t.IsClass() && !exceptions.Contains(t))
3737
.Where(t => t.Name.Split('`')[0].EndsWith("Base"))
38-
.Where(t => !t.IsAbstract)
38+
.Where(t => !t.IsAbstractClass())
3939
.Select(t => t.Name.Split('`')[0])
4040
.ToList();
4141

src/Tests/Framework/Extensions/TypeExtensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ internal static bool IsGeneric(this Type type)
3030
#endif
3131
}
3232

33+
internal static bool IsAbstractClass(this Type type)
34+
{
35+
#if DOTNETCORE
36+
return type.GetTypeInfo().IsAbstract;
37+
#else
38+
return type.IsAbstract;
39+
#endif
40+
}
41+
3342
internal static bool IsValue(this Type type)
3443
{
3544
#if DOTNETCORE

0 commit comments

Comments
 (0)