We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff09540 commit 9e81bcfCopy full SHA for 9e81bcf
Orm/Xtensive.Orm/Reflection/TypeHelper.cs
@@ -1188,9 +1188,11 @@ public static bool IsAnonymous(this Type type)
1188
/// </returns>
1189
public static bool IsClosure(this Type type)
1190
{
1191
+ if (type.BaseType != WellKnownTypes.Object) {
1192
+ return false;
1193
+ }
1194
var typeName = type.Name;
- return type.BaseType == WellKnownTypes.Object
- && (typeName.StartsWith("<>", StringComparison.Ordinal) || typeName.StartsWith("VB$", StringComparison.Ordinal))
1195
+ return (typeName.StartsWith("<>", StringComparison.Ordinal) || typeName.StartsWith("VB$", StringComparison.Ordinal))
1196
&& typeName.IndexOf("DisplayClass", StringComparison.Ordinal) >= 0
1197
&& type.IsDefined(CompilerGeneratedAttributeType, false);
1198
}
0 commit comments