Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1f9d221

Browse filesBrowse files
committed
fixup! Workaround for mono attribute bug
don't try to derive from sealed types
1 parent d2f1ab6 commit 1f9d221
Copy full SHA for 1f9d221

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎src/runtime/StateSerialization/RuntimeData.cs‎

Copy file name to clipboardExpand all lines: src/runtime/StateSerialization/RuntimeData.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ internal static class NonSerializedTypeBuilder
4444
private static Func<Type, bool> isNestedType = (tp) => hasVisibility(tp, TypeAttributes.NestedPrivate) || hasVisibility(tp, TypeAttributes.NestedPublic) || hasVisibility(tp, TypeAttributes.NestedFamily) || hasVisibility(tp, TypeAttributes.NestedAssembly);
4545
private static Func<Type, bool> isPrivateType = (tp) => hasVisibility(tp, TypeAttributes.NotPublic) || hasVisibility(tp, TypeAttributes.NestedPrivate) || hasVisibility(tp, TypeAttributes.NestedFamily) || hasVisibility( tp, TypeAttributes.NestedAssembly);
4646
private static Func<Type, bool> isPublicType = (tp) => hasVisibility(tp, TypeAttributes.Public) || hasVisibility(tp,TypeAttributes.NestedPublic);
47+
private static Func<Type, bool> CanCreateType = (tp) => isPublicType(tp) && ((tp.Attributes & TypeAttributes.Sealed) == 0);
4748

4849
public static object? CreateNewObject(Type baseType)
4950
{
@@ -108,7 +109,7 @@ static string MakeName(Type tp)
108109

109110
public static Type? CreateType(Type tp)
110111
{
111-
if (!isPublicType(tp))
112+
if (!CanCreateType(tp))
112113
{
113114
return null;
114115
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.