diff --git a/src/embed_tests/ClassManagerTests.cs b/src/embed_tests/ClassManagerTests.cs index 9df8fe821..7ba56b59c 100644 --- a/src/embed_tests/ClassManagerTests.cs +++ b/src/embed_tests/ClassManagerTests.cs @@ -110,10 +110,10 @@ public void BindsSnakeCaseClassMethods(string originalMethodName, string snakeCa [TestCase("PublicStringField", "public_string_field")] [TestCase("PublicStaticStringField", "public_static_string_field")] + [TestCase("PublicReadonlyStringField", "public_readonly_string_field")] + [TestCase("PublicStaticReadonlyStringField", "public_static_readonly_string_field")] // Constants [TestCase("PublicConstStringField", "PUBLIC_CONST_STRING_FIELD")] - [TestCase("PublicReadonlyStringField", "PUBLIC_READONLY_STRING_FIELD")] - [TestCase("PublicStaticReadonlyStringField", "PUBLIC_STATIC_READONLY_STRING_FIELD")] public void BindsSnakeCaseClassFields(string originalFieldName, string snakeCaseFieldName) { using var obj = new SnakeCaseNamesTesClass().ToPython(); diff --git a/src/runtime/ClassManager.cs b/src/runtime/ClassManager.cs index 7058b1692..60d0ce467 100644 --- a/src/runtime/ClassManager.cs +++ b/src/runtime/ClassManager.cs @@ -517,7 +517,7 @@ private static ClassInfo GetClassInfo(Type type, ClassBase impl) ci.members[mi.Name] = ob.AllocObject(); var pepName = fi.Name.ToSnakeCase(); - if (fi.IsLiteral || fi.IsInitOnly) + if (fi.IsLiteral) { pepName = pepName.ToUpper(); }