diff --git a/src/ZeroSerializerGenerator.cs b/src/ZeroSerializerGenerator.cs index ba279b0..5cc1985 100644 --- a/src/ZeroSerializerGenerator.cs +++ b/src/ZeroSerializerGenerator.cs @@ -1662,7 +1662,7 @@ private static void CreateShapeTag(ITypeSymbol typeSymbol, StringBuilder shapeTa if (typeSymbol.TypeKind == TypeKind.Enum && typeSymbol is INamedTypeSymbol enumType) { - string prefix = HasFlagsAttribute(enumType) ? "flags:" : "enum:"; + string prefix = "enum:"; string underlyingName = GetPrimitiveKeyword(enumType.EnumUnderlyingType); if (underlyingName.Length == 0) { @@ -1727,24 +1727,4 @@ private static string GetPrimitiveKeyword(ITypeSymbol? typeSymbol) }; } - private static bool HasFlagsAttribute(INamedTypeSymbol enumType) - { - foreach (AttributeData attr in enumType.GetAttributes()) - { - if (attr.AttributeClass is INamedTypeSymbol - { - Name: "FlagsAttribute", ContainingNamespace: INamespaceSymbol - { - Name: "System", ContainingNamespace: INamespaceSymbol - { - IsGlobalNamespace: true - } - } - }) - { - return true; - } - } - return false; - } } diff --git a/tests/ShapeTagAndHashTests.cs b/tests/ShapeTagAndHashTests.cs index 6209a37..b11478b 100644 --- a/tests/ShapeTagAndHashTests.cs +++ b/tests/ShapeTagAndHashTests.cs @@ -47,7 +47,7 @@ public void EnumClassViewTest() [Fact] public void SchemaSignatureTestsModelViewTest() { - string schemaSignatureExpected = "v1/{blittable{int,enum:short},{int,enum:byte},blittable{int,enum:short}[],{},blittable{},{enum:byte,enum:short}?,enum:byte[],flags:ulong[],int?,bool?}"; + string schemaSignatureExpected = "v1/{blittable{int,enum:short},{int,enum:byte},blittable{int,enum:short}[],{},blittable{},{enum:byte,enum:short}?,enum:byte[],enum:ulong[],int?,bool?}"; Assert.Equal(SchemaSignatureTestsModelView.ShapeTag, schemaSignatureExpected); Assert.Equal(SchemaSignatureTestsModelView.ShapeHash, XXHash32.HashToUInt32(schemaSignatureExpected)); }