You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_ =>thrownewNotImplementedException("Could not determine whether the type is a struct, class or record.")
71
-
};
72
-
73
-
if(type.DeclaredAccessibilityis not Accessibility.Public)
74
-
thrownewNotImplementedException(
75
-
$"Generate accessibility of '{type.DeclaredAccessibility}' on '{type.ToDisplayParts()}' only '{type.DeclaredAccessibility==Accessibility.Public}' is supported."
if(type.DeclaredAccessibilityis not Accessibility.Public)
19
+
thrownewNotImplementedException(
20
+
$"Generate accessibility of '{type.DeclaredAccessibility}' on '{type.ToDisplayParts()}' only '{type.DeclaredAccessibility==Accessibility.Public}' is supported."
21
+
);
22
+
23
+
vartypeType=typeswitch
24
+
{
25
+
{IsRecord:true,TypeKind:TypeKind.Class,IsSealed:true}=>$"public {(type.IsStatic?"static ":null)}sealed partial record {type.Name}",
26
+
{IsRecord:true,TypeKind:TypeKind.Class,IsSealed:false}=>$"public {(type.IsStatic?"static ":null)}partial record {type.Name}",
27
+
{IsRecord:false,TypeKind:TypeKind.Class,IsSealed:true}=>$"public {(type.IsStatic?"static ":null)}sealed partial class {type.Name}",
28
+
{IsRecord:false,TypeKind:TypeKind.Class,IsSealed:false}=>$"public {(type.IsStatic?"static ":null)}partial class {type.Name}",
29
+
{IsRecord:true,TypeKind:TypeKind.Struct,IsReadOnly:true}=>$"public {(type.IsStatic?"static ":null)}readonly partial record struct {type.Name}",
0 commit comments