Merge kotlin dsl field generators and move them into kotlin/ sub folder

PiperOrigin-RevId: 682052240
diff --git a/src/google/protobuf/compiler/java/BUILD.bazel b/src/google/protobuf/compiler/java/BUILD.bazel
index 7bb380d..d9940cd 100644
--- a/src/google/protobuf/compiler/java/BUILD.bazel
+++ b/src/google/protobuf/compiler/java/BUILD.bazel
@@ -71,7 +71,10 @@
         "internal_helpers.h",
     ],
     strip_include_prefix = "/src",
-    visibility = ["//src/google/protobuf/compiler/java:__subpackages__"],
+    visibility = [
+        "//src/google/protobuf/compiler/java:__subpackages__",
+        "//src/google/protobuf/compiler/kotlin:__subpackages__",
+    ],
     deps = [
         ":helpers",
         ":java_features_bootstrap",
diff --git a/src/google/protobuf/compiler/java/full/enum_field.cc b/src/google/protobuf/compiler/java/full/enum_field.cc
index e0ea6ee..5150a217 100644
--- a/src/google/protobuf/compiler/java/full/enum_field.cc
+++ b/src/google/protobuf/compiler/java/full/enum_field.cc
@@ -47,7 +47,6 @@
 
   (*variables)["type"] =
       name_resolver->GetImmutableClassName(descriptor->enum_type());
-  variables->insert({"kt_type", EscapeKotlinKeywords((*variables)["type"])});
   (*variables)["mutable_type"] =
       name_resolver->GetMutableClassName(descriptor->enum_type());
   (*variables)["default"] =
@@ -62,12 +61,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   if (HasHasbit(descriptor)) {
     // For singular messages and builders, one bit is used for the hasField bit.
     (*variables)["get_has_field_bit_message"] = GenerateGetBit(messageBitIndex);
@@ -267,51 +260,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void ImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-                 "  @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
-                 "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-                 "  @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
-                 "  set(value) {\n"
-                 "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-                 "  }\n");
-
-  if (SupportUnknownEnumValue(descriptor_)) {
-    printer->Print(
-        variables_,
-        "$kt_deprecation$public var $kt_name$Value: kotlin.Int\n"
-        "  @JvmName(\"${$get$kt_capitalized_name$Value$}$\")\n"
-        "  get() = $kt_dsl_builder$.${$$kt_property_name$Value$}$\n"
-        "  @JvmName(\"${$set$kt_capitalized_name$Value$}$\")\n"
-        "  set(value) {\n"
-        "    $kt_dsl_builder$.${$$kt_property_name$Value$}$ = value\n"
-        "  }\n");
-  }
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        variables_,
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutableEnumFieldGenerator::GenerateFieldBuilderInitializationCode(
     io::Printer* printer) const {
   // noop for enums
@@ -1077,107 +1025,6 @@
                  "}\n");
 }
 
-void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  printer->Print(
-      variables_,
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$public val $kt_name$: "
-                 "com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-                 "  @kotlin.jvm.JvmSynthetic\n"
-                 "  get() = com.google.protobuf.kotlin.DslList(\n"
-                 "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-                 "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "add(value: $kt_type$) {\n"
-                 "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n"
-                 "@Suppress(\"NOTHING_TO_INLINE\")\n"
-                 "public inline operator fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "plusAssign(value: $kt_type$) {\n"
-                 "  add(value)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-                 "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "clear() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}");
-}
-
 std::string RepeatedImmutableEnumFieldGenerator::GetBoxedType() const {
   return name_resolver_->GetImmutableClassName(descriptor_->enum_type());
 }
diff --git a/src/google/protobuf/compiler/java/full/enum_field.h b/src/google/protobuf/compiler/java/full/enum_field.h
index c238fad..bfd6184 100644
--- a/src/google/protobuf/compiler/java/full/enum_field.h
+++ b/src/google/protobuf/compiler/java/full/enum_field.h
@@ -65,7 +65,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -131,7 +130,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 };
diff --git a/src/google/protobuf/compiler/java/full/map_field.cc b/src/google/protobuf/compiler/java/full/map_field.cc
index be36f7d..e081504 100644
--- a/src/google/protobuf/compiler/java/full/map_field.cc
+++ b/src/google/protobuf/compiler/java/full/map_field.cc
@@ -42,17 +42,6 @@
   }
 }
 
-std::string KotlinTypeName(const FieldDescriptor* field,
-                           ClassNameResolver* name_resolver) {
-  if (GetJavaType(field) == JAVATYPE_MESSAGE) {
-    return name_resolver->GetImmutableClassName(field->message_type());
-  } else if (GetJavaType(field) == JAVATYPE_ENUM) {
-    return name_resolver->GetImmutableClassName(field->enum_type());
-  } else {
-    return std::string(KotlinTypeName(GetJavaType(field)));
-  }
-}
-
 std::string WireType(const FieldDescriptor* field) {
   return absl::StrCat("com.google.protobuf.WireFormat.FieldType.",
                       FieldTypeName(field->type()));
@@ -93,8 +82,6 @@
   variables_["key_type"] = TypeName(key, name_resolver, false);
   std::string boxed_key_type = TypeName(key, name_resolver, true);
   variables_["boxed_key_type"] = boxed_key_type;
-  variables_["kt_key_type"] = KotlinTypeName(key, name_resolver);
-  variables_["kt_value_type"] = KotlinTypeName(value, name_resolver);
   // Used for calling the serialization function.
   variables_["short_key_type"] =
       boxed_key_type.substr(boxed_key_type.rfind('.') + 1);
@@ -170,12 +157,6 @@
   // by the proto compiler
   variables_["deprecation"] =
       descriptor_->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables_.insert(
-      {"kt_deprecation",
-       descriptor_->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          variables_["name"], " is deprecated\") ")
-           : ""});
   variables_["on_changed"] = "onChanged();";
 
   variables_.insert(
@@ -959,95 +940,6 @@
   printer->Annotate("{", "}", descriptor_);
 }
 
-void ImmutableMapFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  printer->Print(
-      variables_,
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "$kt_deprecation$ public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  @kotlin.jvm.JvmSynthetic\n"
-      "  @JvmName(\"get$kt_capitalized_name$Map\")\n"
-      "  get() = com.google.protobuf.kotlin.DslMap(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$Map$}$\n"
-      "  )\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@JvmName(\"put$kt_capitalized_name$\")\n"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .put(key: $kt_key_type$, value: $kt_value_type$) {\n"
-      "     $kt_dsl_builder$.${$put$capitalized_name$$}$(key, value)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@JvmName(\"set$kt_capitalized_name$\")\n"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .set(key: $kt_key_type$, value: $kt_value_type$) {\n"
-      "     put(key, value)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@JvmName(\"remove$kt_capitalized_name$\")\n"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .remove(key: $kt_key_type$) {\n"
-      "     $kt_dsl_builder$.${$remove$capitalized_name$$}$(key)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@JvmName(\"putAll$kt_capitalized_name$\")\n"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .putAll(map: kotlin.collections.Map<$kt_key_type$, "
-      "$kt_value_type$>) "
-      "{\n"
-      "     $kt_dsl_builder$.${$putAll$capitalized_name$$}$(map)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@JvmName(\"clear$kt_capitalized_name$\")\n"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .clear() {\n"
-      "     $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "   }\n");
-}
-
 void ImmutableMapFieldGenerator::GenerateFieldBuilderInitializationCode(
     io::Printer* printer) const {
   // Nothing to initialize.
diff --git a/src/google/protobuf/compiler/java/full/map_field.h b/src/google/protobuf/compiler/java/full/map_field.h
index c41205c..5635324 100644
--- a/src/google/protobuf/compiler/java/full/map_field.h
+++ b/src/google/protobuf/compiler/java/full/map_field.h
@@ -44,7 +44,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/full/message_field.cc b/src/google/protobuf/compiler/java/full/message_field.cc
index f26c57b..80ec9ad 100644
--- a/src/google/protobuf/compiler/java/full/message_field.cc
+++ b/src/google/protobuf/compiler/java/full/message_field.cc
@@ -43,7 +43,6 @@
 
   (*variables)["type"] =
       name_resolver->GetImmutableClassName(descriptor->message_type());
-  variables->insert({"kt_type", EscapeKotlinKeywords((*variables)["type"])});
   (*variables)["mutable_type"] =
       name_resolver->GetMutableClassName(descriptor->message_type());
   (*variables)["group_or_message"] =
@@ -53,12 +52,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   (*variables)["on_changed"] = "onChanged();";
   (*variables)["get_parser"] = "parser()";
 
@@ -371,50 +364,6 @@
       "}\n");
 }
 
-void ImmutableMessageFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-                 "  @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
-                 "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-                 "  @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
-                 "  set(value) {\n"
-                 "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-                 "  }\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-                 "  $kt_dsl_builder$.clear$capitalized_name$()\n"
-                 "}\n");
-  printer->Annotate("{", "}", descriptor_, Semantic::kSet);
-
-  WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-      "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-      "}\n");
-
-  GenerateKotlinOrNull(printer);
-}
-
-void ImmutableMessageFieldGenerator::GenerateKotlinOrNull(io::Printer* printer) const {
-  if (descriptor_->has_presence() &&
-      descriptor_->real_containing_oneof() == nullptr) {
-    printer->Print(variables_,
-                   "$kt_deprecation$\n"
-                   "public val $classname$Kt.Dsl.$name$OrNull: $kt_type$?\n"
-                   "  get() = $kt_dsl_builder$.$name$OrNull\n");
-  }
-}
-
 void ImmutableMessageFieldGenerator::GenerateFieldBuilderInitializationCode(
     io::Printer* printer) const {
   printer->Print(variables_, "get$capitalized_name$FieldBuilder();\n");
@@ -1356,107 +1305,6 @@
   return name_resolver_->GetImmutableClassName(descriptor_->message_type());
 }
 
-void RepeatedImmutableMessageFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  printer->Print(
-      variables_,
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$ public val $kt_name$: "
-                 "com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-                 "  @kotlin.jvm.JvmSynthetic\n"
-                 "  get() = com.google.protobuf.kotlin.DslList(\n"
-                 "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-                 "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "add(value: $kt_type$) {\n"
-                 "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-                 "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n"
-                 "@Suppress(\"NOTHING_TO_INLINE\")\n"
-                 "public inline operator fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "plusAssign(value: $kt_type$) {\n"
-                 "  add(value)\n"
-                 "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-                 "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-                 "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "clear() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}\n\n");
-}
-
 }  // namespace java
 }  // namespace compiler
 }  // namespace protobuf
diff --git a/src/google/protobuf/compiler/java/full/message_field.h b/src/google/protobuf/compiler/java/full/message_field.h
index 709ea43..ee9c407 100644
--- a/src/google/protobuf/compiler/java/full/message_field.h
+++ b/src/google/protobuf/compiler/java/full/message_field.h
@@ -66,7 +66,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -87,9 +86,6 @@
       const char* trailing_code,
       absl::optional<io::AnnotationCollector::Semantic> semantic =
           absl::nullopt) const;
-
- private:
-  void GenerateKotlinOrNull(io::Printer* printer) const;
 };
 
 class ImmutableMessageOneofFieldGenerator
@@ -143,7 +139,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/full/primitive_field.cc b/src/google/protobuf/compiler/java/full/primitive_field.cc
index b9fe799..0aa274c 100644
--- a/src/google/protobuf/compiler/java/full/primitive_field.cc
+++ b/src/google/protobuf/compiler/java/full/primitive_field.cc
@@ -46,7 +46,6 @@
 
   (*variables)["type"] = std::string(PrimitiveTypeName(javaType));
   (*variables)["boxed_type"] = std::string(BoxedPrimitiveTypeName(javaType));
-  (*variables)["kt_type"] = std::string(KotlinTypeName(javaType));
   variables->insert({"field_type", (*variables)["type"]});
 
   std::string name = (*variables)["name"];
@@ -100,11 +99,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  (*variables)["kt_deprecation"] =
-      descriptor->options().deprecated()
-          ? absl::StrCat("@kotlin.Deprecated(message = \"Field ", name,
-                         " is deprecated\") ")
-          : "";
   int fixed_size = FixedSize(GetType(descriptor));
   if (fixed_size != -1) {
     (*variables)["fixed_size"] = absl::StrCat(fixed_size);
@@ -287,52 +281,6 @@
                  "}\n");
 }
 
-void ImmutablePrimitiveFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  if (descriptor_->name() == "is_initialized") {
-    printer->Print(
-        variables_,
-        "// TODO: remove this hack; we should access properties\n"
-        "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-        "  @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
-        "  get() = $kt_dsl_builder$.${$get$kt_capitalized_name$$}$()\n"
-        "  @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
-        "  set(value) {\n"
-        "    $kt_dsl_builder$.${$set$kt_capitalized_name$$}$(value)\n"
-        "  }\n");
-  } else {
-    printer->Print(variables_,
-                   "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-                   "  @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
-                   "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-                   "  @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
-                   "  set(value) {\n"
-                   "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-                   "  }\n");
-  }
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        variables_,
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutablePrimitiveFieldGenerator::GenerateFieldBuilderInitializationCode(
     io::Printer* printer) const {
   // noop for primitives
@@ -840,107 +788,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void RepeatedImmutablePrimitiveFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  printer->Print(
-      variables_,
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$ public val $kt_name$: "
-                 "com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-                 "  @kotlin.jvm.JvmSynthetic\n"
-                 "  get() = com.google.protobuf.kotlin.DslList(\n"
-                 "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-                 "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "add(value: $kt_type$) {\n"
-                 "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n"
-                 "@Suppress(\"NOTHING_TO_INLINE\")\n"
-                 "public inline operator fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "plusAssign(value: $kt_type$) {\n"
-                 "  add(value)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-                 "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-                 "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-                 "clear() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}");
-}
-
 void RepeatedImmutablePrimitiveFieldGenerator::
     GenerateFieldBuilderInitializationCode(io::Printer* printer) const {
   // noop for primitives
diff --git a/src/google/protobuf/compiler/java/full/primitive_field.h b/src/google/protobuf/compiler/java/full/primitive_field.h
index 6533228..948800b 100644
--- a/src/google/protobuf/compiler/java/full/primitive_field.h
+++ b/src/google/protobuf/compiler/java/full/primitive_field.h
@@ -65,7 +65,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -131,7 +130,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 };
diff --git a/src/google/protobuf/compiler/java/full/string_field.cc b/src/google/protobuf/compiler/java/full/string_field.cc
index d5b5d58..3b04552 100644
--- a/src/google/protobuf/compiler/java/full/string_field.cc
+++ b/src/google/protobuf/compiler/java/full/string_field.cc
@@ -71,12 +71,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   (*variables)["on_changed"] = "onChanged();";
 
   if (HasHasbit(descriptor)) {
@@ -366,39 +360,6 @@
                  "}\n");
 }
 
-void ImmutableStringFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$public var $kt_name$: kotlin.String\n"
-                 "  @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
-                 "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-                 "  @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
-                 "  set(value) {\n"
-                 "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-                 "  }\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        variables_,
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutableStringFieldGenerator::GenerateFieldBuilderInitializationCode(
     io::Printer* printer) const {
   // noop for primitives
@@ -970,115 +931,6 @@
                  "}\n");
 }
 
-void RepeatedImmutableStringFieldGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  printer->Print(
-      variables_,
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  // property for List<String>
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "$kt_deprecation$public val $kt_name$: "
-                 "com.google.protobuf.kotlin.DslList"
-                 "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>\n"
-                 "  @kotlin.jvm.JvmSynthetic\n"
-                 "  get() = com.google.protobuf.kotlin.DslList(\n"
-                 "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-                 "  )\n");
-
-  // List<String>.add(String)
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-                 "add(value: kotlin.String) {\n"
-                 "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-                 "}\n");
-
-  // List<String> += String
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n"
-                 "@Suppress(\"NOTHING_TO_INLINE\")\n"
-                 "public inline operator fun com.google.protobuf.kotlin.DslList"
-                 "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-                 "plusAssign(value: kotlin.String) {\n"
-                 "  add(value)\n"
-                 "}\n");
-
-  // List<String>.addAll(Iterable<String>)
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "addAll(values: kotlin.collections.Iterable<kotlin.String>) {\n"
-      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-      "}\n");
-
-  // List<String> += Iterable<String>
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<kotlin.String>) {\n"
-      "  addAll(values)\n"
-      "}\n");
-
-  // List<String>[Int] = String
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      variables_,
-      "@kotlin.jvm.JvmSynthetic\n"
-      "@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: kotlin.String) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(variables_,
-                 "@kotlin.jvm.JvmSynthetic\n"
-                 "@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n"
-                 "public fun com.google.protobuf.kotlin.DslList"
-                 "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-                 "clear() {\n"
-                 "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-                 "}");
-}
-
 void RepeatedImmutableStringFieldGenerator::
     GenerateFieldBuilderInitializationCode(io::Printer* printer) const {
   // noop for primitives
diff --git a/src/google/protobuf/compiler/java/full/string_field.h b/src/google/protobuf/compiler/java/full/string_field.h
index 1d2d1b7..d937396 100644
--- a/src/google/protobuf/compiler/java/full/string_field.h
+++ b/src/google/protobuf/compiler/java/full/string_field.h
@@ -64,7 +64,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -129,7 +128,6 @@
       io::Printer* printer) const override;
   void GenerateEqualsCode(io::Printer* printer) const override;
   void GenerateHashCode(io::Printer* printer) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 };
diff --git a/src/google/protobuf/compiler/java/generator_common.h b/src/google/protobuf/compiler/java/generator_common.h
index 33843a0..c2c8859 100644
--- a/src/google/protobuf/compiler/java/generator_common.h
+++ b/src/google/protobuf/compiler/java/generator_common.h
@@ -23,7 +23,6 @@
  public:
   virtual ~FieldGenerator() = default;
   virtual void GenerateSerializationCode(io::Printer* printer) const = 0;
-  virtual void GenerateKotlinDslMembers(io::Printer* printer) const = 0;
 };
 
 // Convenience class which constructs FieldGenerators for a Descriptor.
diff --git a/src/google/protobuf/compiler/java/lite/enum_field.cc b/src/google/protobuf/compiler/java/lite/enum_field.cc
index 4d48876..a6eda65 100644
--- a/src/google/protobuf/compiler/java/lite/enum_field.cc
+++ b/src/google/protobuf/compiler/java/lite/enum_field.cc
@@ -53,7 +53,6 @@
 
   (*variables)["type"] =
       name_resolver->GetImmutableClassName(descriptor->enum_type());
-  variables->insert({"kt_type", EscapeKotlinKeywords((*variables)["type"])});
   (*variables)["mutable_type"] =
       name_resolver->GetMutableClassName(descriptor->enum_type());
   (*variables)["default"] =
@@ -68,12 +67,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   (*variables)["required"] = descriptor->is_required() ? "true" : "false";
 
   if (HasHasbit(descriptor)) {
@@ -298,63 +291,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void ImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name_get",
-           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
-          {"jvm_name_set",
-           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
-      },
-      "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-      "  $jvm_name_get$"
-      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-      "  $jvm_name_set$"
-      "  set(value) {\n"
-      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-      "  }\n");
-
-  if (SupportUnknownEnumValue(descriptor_)) {
-    printer->Emit(
-        {
-            {"jvm_name_get",
-             [&] { JvmName("${$get$kt_capitalized_name$Value$}$", name_ctx); }},
-            {"jvm_name_set",
-             [&] { JvmName("${$set$kt_capitalized_name$Value$}$", name_ctx); }},
-        },
-        "$kt_deprecation$public var $kt_name$Value: kotlin.Int\n"
-        "  $jvm_name_get$"
-        "  get() = $kt_dsl_builder$.${$$kt_property_name$Value$}$\n"
-        "  $jvm_name_set$"
-        "  set(value) {\n"
-        "    $kt_dsl_builder$.${$$kt_property_name$Value$}$ = value\n"
-        "  }\n");
-  }
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutableEnumFieldLiteGenerator::GenerateInitializationCode(
     io::Printer* printer) const {
   if (!IsDefaultValueJavaDefault(descriptor_)) {
@@ -903,128 +839,6 @@
   printer->Print(variables_, "$name$_ = emptyIntList();\n");
 }
 
-void RepeatedImmutableEnumFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  printer->Print(
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      "$kt_deprecation$ public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "$  jvm_synthetic$"
-      "  get() = com.google.protobuf.kotlin.DslList(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-      "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "add(value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(value: $kt_type$) {\n"
-      "  add(value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "clear() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}");
-}
-
 std::string RepeatedImmutableEnumFieldLiteGenerator::GetBoxedType() const {
   return name_resolver_->GetImmutableClassName(descriptor_->enum_type());
 }
diff --git a/src/google/protobuf/compiler/java/lite/enum_field.h b/src/google/protobuf/compiler/java/lite/enum_field.h
index 5bcc00d..44090d3 100644
--- a/src/google/protobuf/compiler/java/lite/enum_field.h
+++ b/src/google/protobuf/compiler/java/lite/enum_field.h
@@ -55,7 +55,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -103,7 +102,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/lite/map_field.cc b/src/google/protobuf/compiler/java/lite/map_field.cc
index 29d285c..433af22 100644
--- a/src/google/protobuf/compiler/java/lite/map_field.cc
+++ b/src/google/protobuf/compiler/java/lite/map_field.cc
@@ -41,17 +41,6 @@
   }
 }
 
-std::string KotlinTypeName(const FieldDescriptor* field,
-                           ClassNameResolver* name_resolver) {
-  if (GetJavaType(field) == JAVATYPE_MESSAGE) {
-    return name_resolver->GetImmutableClassName(field->message_type());
-  } else if (GetJavaType(field) == JAVATYPE_ENUM) {
-    return name_resolver->GetImmutableClassName(field->enum_type());
-  } else {
-    return std::string(KotlinTypeName(GetJavaType(field)));
-  }
-}
-
 std::string WireType(const FieldDescriptor* field) {
   return absl::StrCat("com.google.protobuf.WireFormat.FieldType.",
                       FieldTypeName(field->type()));
@@ -78,8 +67,6 @@
 
   (*variables)["key_type"] = TypeName(key, name_resolver, false);
   (*variables)["boxed_key_type"] = TypeName(key, name_resolver, true);
-  (*variables)["kt_key_type"] = KotlinTypeName(key, name_resolver);
-  (*variables)["kt_value_type"] = KotlinTypeName(value, name_resolver);
   (*variables)["key_wire_type"] = WireType(key);
   (*variables)["key_default_value"] =
       DefaultValue(key, true, name_resolver, context->options());
@@ -141,12 +128,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
 
   variables->insert(
       {"default_entry", absl::StrCat((*variables)["capitalized_name"],
@@ -835,111 +816,6 @@
   }
 }
 
-void ImmutableMapFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  printer->Print(
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("get$kt_capitalized_name$Map", name_ctx); }},
-      },
-      "$kt_deprecation$ public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "$  jvm_synthetic$"
-      "$jvm_name$"
-      "  get() = com.google.protobuf.kotlin.DslMap(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$Map$}$\n"
-      "  )\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("put$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .put(key: $kt_key_type$, value: $kt_value_type$) {\n"
-      "     $kt_dsl_builder$.${$put$capitalized_name$$}$(key, value)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .set(key: $kt_key_type$, value: $kt_value_type$) {\n"
-      "     put(key, value)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("remove$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .remove(key: $kt_key_type$) {\n"
-      "     $kt_dsl_builder$.${$remove$capitalized_name$$}$(key)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("putAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .putAll(map: kotlin.collections.Map<$kt_key_type$, $kt_value_type$>) "
-      "{\n"
-      "     $kt_dsl_builder$.${$putAll$capitalized_name$$}$(map)\n"
-      "   }\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslMap"
-      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "  .clear() {\n"
-      "     $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "   }\n");
-}
-
 void ImmutableMapFieldLiteGenerator::GenerateInitializationCode(
     io::Printer* printer) const {
   // Nothing to initialize.
diff --git a/src/google/protobuf/compiler/java/lite/map_field.h b/src/google/protobuf/compiler/java/lite/map_field.h
index eb72891..846ccc2 100644
--- a/src/google/protobuf/compiler/java/lite/map_field.h
+++ b/src/google/protobuf/compiler/java/lite/map_field.h
@@ -38,7 +38,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/lite/message_field.cc b/src/google/protobuf/compiler/java/lite/message_field.cc
index 2346747..79fcf95 100644
--- a/src/google/protobuf/compiler/java/lite/message_field.cc
+++ b/src/google/protobuf/compiler/java/lite/message_field.cc
@@ -44,7 +44,6 @@
 
   (*variables)["type"] =
       name_resolver->GetImmutableClassName(descriptor->message_type());
-  variables->insert({"kt_type", EscapeKotlinKeywords((*variables)["type"])});
   (*variables)["mutable_type"] =
       name_resolver->GetMutableClassName(descriptor->message_type());
   (*variables)["group_or_message"] =
@@ -54,12 +53,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   (*variables)["required"] = descriptor->is_required() ? "true" : "false";
 
   if (HasHasbit(descriptor)) {
@@ -276,56 +269,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void ImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name_get",
-           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
-          {"jvm_name_set",
-           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
-      },
-      "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-      "  $jvm_name_get$"
-      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-      "  $jvm_name_set$"
-      "  set(value) {\n"
-      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-      "  }\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-      "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-      "}\n");
-  GenerateKotlinOrNull(printer);
-}
-
-void ImmutableMessageFieldLiteGenerator::GenerateKotlinOrNull(
-    io::Printer* printer) const {
-  if (descriptor_->has_presence() &&
-      descriptor_->real_containing_oneof() == nullptr) {
-    printer->Print(
-        "$kt_deprecation$\n"
-        "public val $classname$Kt.Dsl.$name$OrNull: $kt_type$?\n"
-        "  get() = $kt_dsl_builder$.$name$OrNull\n");
-  }
-}
-
 void ImmutableMessageFieldLiteGenerator::GenerateFieldInfo(
     io::Printer* printer, std::vector<uint16_t>* output) const {
   WriteIntToUtf16CharSequence(descriptor_->number(), output);
@@ -810,130 +753,6 @@
 std::string RepeatedImmutableMessageFieldLiteGenerator::GetBoxedType() const {
   return name_resolver_->GetImmutableClassName(descriptor_->message_type());
 }
-
-void RepeatedImmutableMessageFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  printer->Print(
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Print(
-      "$kt_deprecation$ public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "$  jvm_synthetic$"
-      "  get() = com.google.protobuf.kotlin.DslList(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-      "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "add(value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(value: $kt_type$) {\n"
-      "  add(value)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
-      },
-
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "clear() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}\n");
-}
-
 }  // namespace java
 }  // namespace compiler
 }  // namespace protobuf
diff --git a/src/google/protobuf/compiler/java/lite/message_field.h b/src/google/protobuf/compiler/java/lite/message_field.h
index 495b393..8424bf3 100644
--- a/src/google/protobuf/compiler/java/lite/message_field.h
+++ b/src/google/protobuf/compiler/java/lite/message_field.h
@@ -57,7 +57,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -69,7 +68,6 @@
   Context* context_;
 
  private:
-  void GenerateKotlinOrNull(io::Printer* printer) const;
 };
 
 class ImmutableMessageOneofFieldLiteGenerator
@@ -110,7 +108,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/lite/primitive_field.cc b/src/google/protobuf/compiler/java/lite/primitive_field.cc
index 3e0d174..2cbcd3e 100644
--- a/src/google/protobuf/compiler/java/lite/primitive_field.cc
+++ b/src/google/protobuf/compiler/java/lite/primitive_field.cc
@@ -52,7 +52,6 @@
   JavaType javaType = GetJavaType(descriptor);
   (*variables)["type"] = std::string(PrimitiveTypeName(javaType));
   (*variables)["boxed_type"] = std::string(BoxedPrimitiveTypeName(javaType));
-  (*variables)["kt_type"] = std::string(KotlinTypeName(javaType));
   variables->insert({"field_type", (*variables)["type"]});
   (*variables)["default"] =
       ImmutableDefaultValue(descriptor, name_resolver, context->options());
@@ -121,11 +120,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  (*variables)["kt_deprecation"] =
-      descriptor->options().deprecated()
-          ? absl::StrCat("@kotlin.Deprecated(message = \"Field ", name,
-                         " is deprecated\") ")
-          : "";
   int fixed_size = FixedSize(GetType(descriptor));
   if (fixed_size != -1) {
     (*variables)["fixed_size"] = absl::StrCat(fixed_size);
@@ -326,63 +320,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void ImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  WriteFieldDocComment(printer, descriptor_, context_->options());
-  if (descriptor_->name() == "is_initialized") {
-    printer->Emit(
-        {
-            {"jvm_name_get",
-             [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
-            {"jvm_name_set",
-             [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
-        },
-        "// TODO: b/336400327 - remove this hack; we should access properties\n"
-        "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-        "  $jvm_name_get$"
-        "  get() = $kt_dsl_builder$.get${$$kt_capitalized_name$$}$()\n"
-        "  $jvm_name_set$"
-        "  set(value) {\n"
-        "    $kt_dsl_builder$.${$set$kt_capitalized_name$$}$(value)\n"
-        "  }\n");
-  } else {
-    printer->Emit(
-        {
-            {"jvm_name_get",
-             [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
-            {"jvm_name_set",
-             [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
-        },
-        "$kt_deprecation$public var $kt_name$: $kt_type$\n"
-        "  $jvm_name_get$"
-        "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-        "  $jvm_name_set$"
-        "  set(value) {\n"
-        "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-        "  }\n");
-  }
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutablePrimitiveFieldLiteGenerator::GenerateFieldInfo(
     io::Printer* printer, std::vector<uint16_t>* output) const {
   WriteIntToUtf16CharSequence(descriptor_->number(), output);
@@ -723,127 +660,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  printer->Print(
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  WriteFieldDocComment(printer, descriptor_, context_->options());
-  printer->Print(
-      "$kt_deprecation$ public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "$  jvm_synthetic$"
-      "  get() = com.google.protobuf.kotlin.DslList(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-      "  )\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "add(value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(value: $kt_type$) {\n"
-      "  add(value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
-      "  addAll(values)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: $kt_type$) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
-      "clear() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}");
-}
-
 void RepeatedImmutablePrimitiveFieldLiteGenerator::GenerateFieldInfo(
     io::Printer* printer, std::vector<uint16_t>* output) const {
   WriteIntToUtf16CharSequence(descriptor_->number(), output);
diff --git a/src/google/protobuf/compiler/java/lite/primitive_field.h b/src/google/protobuf/compiler/java/lite/primitive_field.h
index 56b6fc7..eb6d5f5 100644
--- a/src/google/protobuf/compiler/java/lite/primitive_field.h
+++ b/src/google/protobuf/compiler/java/lite/primitive_field.h
@@ -57,7 +57,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -107,7 +106,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/java/lite/string_field.cc b/src/google/protobuf/compiler/java/lite/string_field.cc
index 05237fc..6ce00aa 100644
--- a/src/google/protobuf/compiler/java/lite/string_field.cc
+++ b/src/google/protobuf/compiler/java/lite/string_field.cc
@@ -62,12 +62,6 @@
   // by the proto compiler
   (*variables)["deprecation"] =
       descriptor->options().deprecated() ? "@java.lang.Deprecated " : "";
-  variables->insert(
-      {"kt_deprecation",
-       descriptor->options().deprecated()
-           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
-                          (*variables)["name"], " is deprecated\") ")
-           : ""});
   (*variables)["required"] = descriptor->is_required() ? "true" : "false";
   if (!context->options().opensource_runtime) {
     (*variables)["enforce_utf8"] = CheckUtf8(descriptor) ? "true" : "false";
@@ -327,46 +321,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void ImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  WriteFieldDocComment(printer, descriptor_, context_->options(),
-                       /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name_get",
-           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
-          {"jvm_name_set",
-           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
-      },
-      "$kt_deprecation$public var $kt_name$: kotlin.String\n"
-      "  $jvm_name_get$"
-      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
-      "  $jvm_name_set$"
-      "  set(value) {\n"
-      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
-      "  }\n");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}\n");
-
-  if (descriptor_->has_presence()) {
-    WriteFieldAccessorDocComment(printer, descriptor_, HAZZER,
-                                 context_->options(),
-                                 /* builder */ false, /* kdoc */ true);
-    printer->Print(
-        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
-        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
-        "}\n");
-  }
-}
-
 void ImmutableStringFieldLiteGenerator::GenerateFieldInfo(
     io::Printer* printer, std::vector<uint16_t>* output) const {
   WriteIntToUtf16CharSequence(descriptor_->number(), output);
@@ -808,135 +762,6 @@
   printer->Annotate("{", "}", descriptor_, Semantic::kSet);
 }
 
-void RepeatedImmutableStringFieldLiteGenerator::GenerateKotlinDslMembers(
-    io::Printer* printer) const {
-  auto vars = printer->WithVars(variables_);
-  JvmNameContext name_ctx = {context_->options(), printer};
-  printer->Print(
-      "/**\n"
-      " * An uninstantiable, behaviorless type to represent the field in\n"
-      " * generics.\n"
-      " */\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
-      " : com.google.protobuf.kotlin.DslProxy()\n");
-
-  // property for List<String>
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_GETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Print(
-      "$kt_deprecation$public val $kt_name$: "
-      "com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>\n"
-      "@kotlin.OptIn"
-      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
-      "  get() = com.google.protobuf.kotlin.DslList(\n"
-      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
-      "  )\n");
-
-  // List<String>.add(String)
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "add(value: kotlin.String) {\n"
-      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
-      "}\n");
-
-  // List<String> += String
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(value: kotlin.String) {\n"
-      "  add(value)\n"
-      "}\n");
-
-  // List<String>.addAll(Iterable<String>)
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "addAll(values: kotlin.collections.Iterable<kotlin.String>) {\n"
-      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
-      "}\n");
-
-  // List<String> += Iterable<String>
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_MULTI_ADDER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name",
-           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "@Suppress(\"NOTHING_TO_INLINE\")\n"
-      "public inline operator fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "plusAssign(values: kotlin.collections.Iterable<kotlin.String>) {\n"
-      "  addAll(values)\n"
-      "}\n");
-
-  // List<String>[Int] = String
-  WriteFieldAccessorDocComment(printer, descriptor_, LIST_INDEXED_SETTER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public operator fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "set(index: kotlin.Int, value: kotlin.String) {\n"
-      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
-      "}");
-
-  WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
-                               context_->options(),
-                               /* builder */ false, /* kdoc */ true);
-  printer->Emit(
-      {
-          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
-      },
-      "$jvm_synthetic$"
-      "$jvm_name$"
-      "public fun com.google.protobuf.kotlin.DslList"
-      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
-      "clear() {\n"
-      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
-      "}");
-}
-
 void RepeatedImmutableStringFieldLiteGenerator::GenerateFieldInfo(
     io::Printer* printer, std::vector<uint16_t>* output) const {
   WriteIntToUtf16CharSequence(descriptor_->number(), output);
diff --git a/src/google/protobuf/compiler/java/lite/string_field.h b/src/google/protobuf/compiler/java/lite/string_field.h
index 5929186..2a83e88 100644
--- a/src/google/protobuf/compiler/java/lite/string_field.h
+++ b/src/google/protobuf/compiler/java/lite/string_field.h
@@ -58,7 +58,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
@@ -107,7 +106,6 @@
   void GenerateInitializationCode(io::Printer* printer) const override;
   void GenerateFieldInfo(io::Printer* printer,
                          std::vector<uint16_t>* output) const override;
-  void GenerateKotlinDslMembers(io::Printer* printer) const override;
 
   std::string GetBoxedType() const override;
 
diff --git a/src/google/protobuf/compiler/kotlin/BUILD.bazel b/src/google/protobuf/compiler/kotlin/BUILD.bazel
index 5555ade..9ecbe77 100644
--- a/src/google/protobuf/compiler/kotlin/BUILD.bazel
+++ b/src/google/protobuf/compiler/kotlin/BUILD.bazel
@@ -22,10 +22,12 @@
 cc_library(
     name = "kotlin_internal",
     srcs = [
+        "field.cc",
         "file.cc",
         "message.cc",
     ],
     hdrs = [
+        "field.h",
         "file.h",
         "message.h",
     ],
@@ -42,12 +44,14 @@
         "//src/google/protobuf/compiler/java",
         "//src/google/protobuf/compiler/java:generator_common",
         "//src/google/protobuf/compiler/java:helpers",
+        "//src/google/protobuf/compiler/java:internal_helpers",
         "//src/google/protobuf/compiler/java/full:fg",
         "//src/google/protobuf/compiler/java/full:mfg",
         "//src/google/protobuf/compiler/java/lite:field_generators",
         "//src/google/protobuf/io",
         "//src/google/protobuf/io:printer",
         "@com_google_absl//absl/container:btree",
+        "@com_google_absl//absl/container:flat_hash_map",
         "@com_google_absl//absl/log:absl_check",
         "@com_google_absl//absl/strings",
     ],
diff --git a/src/google/protobuf/compiler/kotlin/field.cc b/src/google/protobuf/compiler/kotlin/field.cc
new file mode 100644
index 0000000..1f085d1
--- /dev/null
+++ b/src/google/protobuf/compiler/kotlin/field.cc
@@ -0,0 +1,868 @@
+#include "google/protobuf/compiler/kotlin/field.h"
+
+#include <string>
+
+#include "absl/container/flat_hash_map.h"
+#include "absl/strings/str_cat.h"
+#include "absl/strings/string_view.h"
+#include "google/protobuf/compiler/java/context.h"
+#include "google/protobuf/compiler/java/doc_comment.h"
+#include "google/protobuf/compiler/java/field_common.h"
+#include "google/protobuf/compiler/java/helpers.h"
+#include "google/protobuf/compiler/java/internal_helpers.h"
+#include "google/protobuf/compiler/java/name_resolver.h"
+#include "google/protobuf/descriptor.h"
+
+namespace google {
+namespace protobuf {
+namespace compiler {
+namespace kotlin {
+
+FieldGenerator::FieldGenerator(const FieldDescriptor* descriptor,
+                               java::Context* context, bool lite)
+    : descriptor_(descriptor), context_(context), lite_(lite) {
+  java::SetCommonFieldVariables(
+      descriptor, context->GetFieldGeneratorInfo(descriptor), &variables_);
+  variables_.insert(
+      {"kt_deprecation",
+       descriptor->options().deprecated()
+           ? absl::StrCat("@kotlin.Deprecated(message = \"Field ",
+                          variables_["name"], " is deprecated\") ")
+           : ""});
+}
+
+void FieldGenerator::Generate(io::Printer* printer) const {
+  auto cleanup = printer->WithVars(variables_);
+  switch (java::GetJavaType(descriptor_)) {
+    case java::JAVATYPE_MESSAGE:
+      if (descriptor_->is_repeated() &&
+          java::IsMapEntry(descriptor_->message_type())) {
+        GenerateMapField(printer);
+      } else {
+        GenerateMessageField(printer);
+      }
+      break;
+    case java::JAVATYPE_STRING:
+      GenerateStringField(printer);
+      break;
+    case java::JAVATYPE_ENUM:
+      GenerateEnumField(printer);
+      break;
+    default:
+      GeneratePritimiveField(printer);
+      break;
+  }
+}
+
+void FieldGenerator::GeneratePritimiveField(io::Printer* printer) const {
+  java::JavaType javaType = java::GetJavaType(descriptor_);
+  auto cleanup = printer->WithVars(
+      {{"kt_type", std::string(java::KotlinTypeName(javaType))}});
+
+  if (descriptor_->is_repeated()) {
+    GenerateRepeatedPritimiveField(printer);
+    return;
+  }
+
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  java::WriteFieldDocComment(printer, descriptor_, context_->options(),
+                             /* kdoc */ true);
+  if (descriptor_->name() == "is_initialized") {
+    printer->Emit(
+        {
+            {"jvm_name_get",
+             [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
+            {"jvm_name_set",
+             [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
+        },
+        "// TODO: b/336400327 - remove this hack; we should access properties\n"
+        "$kt_deprecation$public var $kt_name$: $kt_type$\n"
+        "  $jvm_name_get$"
+        "  get() = $kt_dsl_builder$.get${$$kt_capitalized_name$$}$()\n"
+        "  $jvm_name_set$"
+        "  set(value) {\n"
+        "    $kt_dsl_builder$.${$set$kt_capitalized_name$$}$(value)\n"
+        "  }\n");
+  } else {
+    printer->Emit(
+        {
+            {"jvm_name_get",
+             [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
+            {"jvm_name_set",
+             [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
+        },
+        "$kt_deprecation$public var $kt_name$: $kt_type$\n"
+        "  $jvm_name_get$"
+        "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
+        "  $jvm_name_set$"
+        "  set(value) {\n"
+        "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
+        "  }\n");
+  }
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Print(
+      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}\n");
+
+  if (descriptor_->has_presence()) {
+    WriteFieldAccessorDocComment(printer, descriptor_, java::HAZZER,
+                                 context_->options(), /* kdoc */ true);
+    printer->Print(
+        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
+        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
+        "}\n");
+  }
+}
+
+void FieldGenerator::GenerateRepeatedPritimiveField(
+    io::Printer* printer) const {
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  printer->Print(
+      "/**\n"
+      " * An uninstantiable, behaviorless type to represent the field in\n"
+      " * generics.\n"
+      " */\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
+      " : com.google.protobuf.kotlin.DslProxy()\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Print(
+      "$kt_deprecation$ public val $kt_name$: "
+      "com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "$  jvm_synthetic$"
+      "  get() = com.google.protobuf.kotlin.DslList(\n"
+      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
+      "  )\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "add(value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(value: $kt_type$) {\n"
+      "  add(value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  addAll(values)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_INDEXED_SETTER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "set(index: kotlin.Int, value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "clear() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}");
+}
+
+void FieldGenerator::GenerateMessageField(io::Printer* printer) const {
+  auto name_resolver = context_->GetNameResolver();
+  auto cleanup = printer->WithVars(
+      {{"kt_type",
+        java::EscapeKotlinKeywords(name_resolver->GetImmutableClassName(
+            descriptor_->message_type()))}});
+
+  if (descriptor_->is_repeated()) {
+    GenerateRepeatedMessageField(printer);
+    return;
+  }
+
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name_get",
+           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
+          {"jvm_name_set",
+           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
+      },
+      "$kt_deprecation$public var $kt_name$: $kt_type$\n"
+      "  $jvm_name_get$"
+      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
+      "  $jvm_name_set$"
+      "  set(value) {\n"
+      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
+      "  }\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Print(
+      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::HAZZER,
+                               context_->options(), /* kdoc */ true);
+  printer->Print(
+      "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
+      "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
+      "}\n");
+  if (descriptor_->has_presence() &&
+      descriptor_->real_containing_oneof() == nullptr) {
+    printer->Print(
+        "$kt_deprecation$\n"
+        "public val $classname$Kt.Dsl.$name$OrNull: $kt_type$?\n"
+        "  get() = $kt_dsl_builder$.$name$OrNull\n");
+  }
+}
+
+void FieldGenerator::GenerateRepeatedMessageField(io::Printer* printer) const {
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  printer->Print(
+      "/**\n"
+      " * An uninstantiable, behaviorless type to represent the field in\n"
+      " * generics.\n"
+      " */\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
+      " : com.google.protobuf.kotlin.DslProxy()\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Print(
+      "$kt_deprecation$ public val $kt_name$: "
+      "com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "$  jvm_synthetic$"
+      "  get() = com.google.protobuf.kotlin.DslList(\n"
+      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
+      "  )\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "add(value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(value: $kt_type$) {\n"
+      "  add(value)\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  addAll(values)\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_INDEXED_SETTER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "set(index: kotlin.Int, value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
+      "}\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
+      },
+
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "clear() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}\n");
+}
+
+void FieldGenerator::GenerateStringField(io::Printer* printer) const {
+  if (descriptor_->is_repeated()) {
+    GenerateRepeatedStringField(printer);
+    return;
+  }
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name_get",
+           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
+          {"jvm_name_set",
+           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
+      },
+      "$kt_deprecation$public var $kt_name$: kotlin.String\n"
+      "  $jvm_name_get$"
+      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
+      "  $jvm_name_set$"
+      "  set(value) {\n"
+      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
+      "  }\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Print(
+      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}\n");
+
+  if (descriptor_->has_presence()) {
+    WriteFieldAccessorDocComment(printer, descriptor_, java::HAZZER,
+                                 context_->options(), /* kdoc */ true);
+    printer->Print(
+        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
+        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
+        "}\n");
+  }
+}
+
+void FieldGenerator::GenerateRepeatedStringField(io::Printer* printer) const {
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  printer->Print(
+      "/**\n"
+      " * An uninstantiable, behaviorless type to represent the field in\n"
+      " * generics.\n"
+      " */\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
+      " : com.google.protobuf.kotlin.DslProxy()\n");
+
+  // property for List<String>
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_GETTER,
+                               context_->options(), /* kdoc */ true);
+  printer->Print(
+      "$kt_deprecation$public val $kt_name$: "
+      "com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "  get() = com.google.protobuf.kotlin.DslList(\n"
+      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
+      "  )\n");
+
+  // List<String>.add(String)
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "add(value: kotlin.String) {\n"
+      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
+      "}\n");
+
+  // List<String> += String
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(value: kotlin.String) {\n"
+      "  add(value)\n"
+      "}\n");
+
+  // List<String>.addAll(Iterable<String>)
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "addAll(values: kotlin.collections.Iterable<kotlin.String>) {\n"
+      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
+      "}\n");
+
+  // List<String> += Iterable<String>
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(values: kotlin.collections.Iterable<kotlin.String>) {\n"
+      "  addAll(values)\n"
+      "}\n");
+
+  // List<String>[Int] = String
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_INDEXED_SETTER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public operator fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "set(index: kotlin.Int, value: kotlin.String) {\n"
+      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<kotlin.String, ${$$kt_capitalized_name$Proxy$}$>."
+      "clear() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}");
+}
+
+void FieldGenerator::GenerateEnumField(io::Printer* printer) const {
+  auto name_resolver = context_->GetNameResolver();
+  auto cleanup = printer->WithVars(
+      {{"kt_type",
+        java::EscapeKotlinKeywords(
+            name_resolver->GetImmutableClassName(descriptor_->enum_type()))}});
+
+  if (descriptor_->is_repeated()) {
+    GenerateRepeatedEnumField(printer);
+    return;
+  }
+
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name_get",
+           [&] { JvmName("${$get$kt_capitalized_name$$}$", name_ctx); }},
+          {"jvm_name_set",
+           [&] { JvmName("${$set$kt_capitalized_name$$}$", name_ctx); }},
+      },
+      "$kt_deprecation$public var $kt_name$: $kt_type$\n"
+      "  $jvm_name_get$"
+      "  get() = $kt_dsl_builder$.${$$kt_safe_name$$}$\n"
+      "  $jvm_name_set$"
+      "  set(value) {\n"
+      "    $kt_dsl_builder$.${$$kt_safe_name$$}$ = value\n"
+      "  }\n");
+
+  if (java::SupportUnknownEnumValue(descriptor_)) {
+    printer->Emit(
+        {
+            {"jvm_name_get",
+             [&] { JvmName("${$get$kt_capitalized_name$Value$}$", name_ctx); }},
+            {"jvm_name_set",
+             [&] { JvmName("${$set$kt_capitalized_name$Value$}$", name_ctx); }},
+        },
+        "$kt_deprecation$public var $kt_name$Value: kotlin.Int\n"
+        "  $jvm_name_get$"
+        "  get() = $kt_dsl_builder$.${$$kt_property_name$Value$}$\n"
+        "  $jvm_name_set$"
+        "  set(value) {\n"
+        "    $kt_dsl_builder$.${$$kt_property_name$Value$}$ = value\n"
+        "  }\n");
+  }
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(),
+                               /* kdoc */ true);
+  printer->Print(
+      "public fun ${$clear$kt_capitalized_name$$}$() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}\n");
+
+  if (descriptor_->has_presence()) {
+    WriteFieldAccessorDocComment(printer, descriptor_, java::HAZZER,
+                                 context_->options(),
+                                 /* kdoc */ true);
+    printer->Print(
+        "public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
+        "  return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
+        "}\n");
+  }
+}
+
+void FieldGenerator::GenerateRepeatedEnumField(io::Printer* printer) const {
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  printer->Print(
+      "/**\n"
+      " * An uninstantiable, behaviorless type to represent the field in\n"
+      " * generics.\n"
+      " */\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
+      " : com.google.protobuf.kotlin.DslProxy()\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Print(
+      "$kt_deprecation$ public val $kt_name$: "
+      "com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "$  jvm_synthetic$"
+      "  get() = com.google.protobuf.kotlin.DslList(\n"
+      "    $kt_dsl_builder$.${$$kt_property_name$List$}$\n"
+      "  )\n");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("add$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "add(value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssign$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(value: $kt_type$) {\n"
+      "  add(value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("addAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_MULTI_ADDER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("plusAssignAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
+      "  addAll(values)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::LIST_INDEXED_SETTER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public operator fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "set(index: kotlin.Int, value: $kt_type$) {\n"
+      "  $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
+      "}");
+
+  WriteFieldAccessorDocComment(printer, descriptor_, java::CLEARER,
+                               context_->options(), /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslList"
+      "<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
+      "clear() {\n"
+      "  $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "}");
+}
+
+namespace {
+std::string KotlinTypeName(const FieldDescriptor* field,
+                           java::ClassNameResolver* name_resolver) {
+  if (java::GetJavaType(field) == java::JAVATYPE_MESSAGE) {
+    return name_resolver->GetImmutableClassName(field->message_type());
+  } else if (java::GetJavaType(field) == java::JAVATYPE_ENUM) {
+    return name_resolver->GetImmutableClassName(field->enum_type());
+  } else {
+    return std::string(java::KotlinTypeName(java::GetJavaType(field)));
+  }
+}
+}  // namespace
+
+void FieldGenerator::GenerateMapField(io::Printer* printer) const {
+  auto name_resolver = context_->GetNameResolver();
+  const FieldDescriptor* key = java::MapKeyField(descriptor_);
+  const FieldDescriptor* value = java::MapValueField(descriptor_);
+  auto cleanup = printer->WithVars(
+      {{"kt_key_type", KotlinTypeName(key, name_resolver)},
+       {"kt_value_type", KotlinTypeName(value, name_resolver)}});
+
+  java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
+  printer->Print(
+      "/**\n"
+      " * An uninstantiable, behaviorless type to represent the field in\n"
+      " * generics.\n"
+      " */\n"
+      "@kotlin.OptIn"
+      "(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
+      "public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
+      " : com.google.protobuf.kotlin.DslProxy()\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("get$kt_capitalized_name$Map", name_ctx); }},
+      },
+      "$kt_deprecation$ public val $kt_name$: "
+      "com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "$  jvm_synthetic$"
+      "$jvm_name$"
+      "  get() = com.google.protobuf.kotlin.DslMap(\n"
+      "    $kt_dsl_builder$.${$$kt_property_name$Map$}$\n"
+      "  )\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("put$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "  .put(key: $kt_key_type$, value: $kt_value_type$) {\n"
+      "     $kt_dsl_builder$.${$put$capitalized_name$$}$(key, value)\n"
+      "   }\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name", [&] { JvmName("set$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "@Suppress(\"NOTHING_TO_INLINE\")\n"
+      "public inline operator fun com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "  .set(key: $kt_key_type$, value: $kt_value_type$) {\n"
+      "     put(key, value)\n"
+      "   }\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("remove$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "  .remove(key: $kt_key_type$) {\n"
+      "     $kt_dsl_builder$.${$remove$capitalized_name$$}$(key)\n"
+      "   }\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("putAll$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "  .putAll(map: kotlin.collections.Map<$kt_key_type$, $kt_value_type$>) "
+      "{\n"
+      "     $kt_dsl_builder$.${$putAll$capitalized_name$$}$(map)\n"
+      "   }\n");
+
+  WriteFieldDocComment(printer, descriptor_, context_->options(),
+                       /* kdoc */ true);
+  printer->Emit(
+      {
+          {"jvm_name",
+           [&] { JvmName("clear$kt_capitalized_name$", name_ctx); }},
+      },
+      "$jvm_synthetic$"
+      "$jvm_name$"
+      "public fun com.google.protobuf.kotlin.DslMap"
+      "<$kt_key_type$, $kt_value_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
+      "  .clear() {\n"
+      "     $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
+      "   }\n");
+}
+
+}  // namespace kotlin
+}  // namespace compiler
+}  // namespace protobuf
+}  // namespace google
diff --git a/src/google/protobuf/compiler/kotlin/field.h b/src/google/protobuf/compiler/kotlin/field.h
new file mode 100644
index 0000000..f9ce4cd
--- /dev/null
+++ b/src/google/protobuf/compiler/kotlin/field.h
@@ -0,0 +1,50 @@
+#ifndef GOOGLE_PROTOBUF_COMPILER_KOTLIN_FIELD_H__
+#define GOOGLE_PROTOBUF_COMPILER_KOTLIN_FIELD_H__
+
+#include <string>
+
+#include "absl/container/flat_hash_map.h"
+#include "absl/strings/string_view.h"
+#include "google/protobuf/compiler/java/context.h"
+#include "google/protobuf/descriptor.h"
+#include "google/protobuf/io/printer.h"
+
+namespace google {
+namespace protobuf {
+namespace compiler {
+namespace kotlin {
+
+class FieldGenerator {
+ public:
+  FieldGenerator(const FieldDescriptor* descriptor, java::Context* context,
+                 bool lite);
+  FieldGenerator(const FieldGenerator&) = delete;
+  FieldGenerator& operator=(const FieldGenerator&) = delete;
+  ~FieldGenerator() = default;
+
+  void Generate(io::Printer* printer) const;
+
+ private:
+  const FieldDescriptor* descriptor_;
+  absl::flat_hash_map<absl::string_view, std::string> variables_;
+  java::Context* context_;
+  bool lite_;
+
+  void GeneratePritimiveField(io::Printer* printer) const;
+  void GenerateMessageField(io::Printer* printer) const;
+  void GenerateMapField(io::Printer* printer) const;
+  void GenerateStringField(io::Printer* printer) const;
+  void GenerateEnumField(io::Printer* printer) const;
+
+  void GenerateRepeatedPritimiveField(io::Printer* printer) const;
+  void GenerateRepeatedMessageField(io::Printer* printer) const;
+  void GenerateRepeatedStringField(io::Printer* printer) const;
+  void GenerateRepeatedEnumField(io::Printer* printer) const;
+};
+
+}  // namespace kotlin
+}  // namespace compiler
+}  // namespace protobuf
+}  // namespace google
+
+#endif  // GOOGLE_PROTOBUF_COMPILER_KOTLIN_FIELD_H__
diff --git a/src/google/protobuf/compiler/kotlin/message.cc b/src/google/protobuf/compiler/kotlin/message.cc
index e64a098..9026dfa 100644
--- a/src/google/protobuf/compiler/kotlin/message.cc
+++ b/src/google/protobuf/compiler/kotlin/message.cc
@@ -7,7 +7,9 @@
 
 #include "google/protobuf/compiler/kotlin/message.h"
 
+#include <memory>
 #include <string>
+#include <utility>
 
 #include "absl/log/absl_check.h"
 #include "absl/strings/str_cat.h"
@@ -16,11 +18,8 @@
 #include "google/protobuf/compiler/java/field_common.h"
 #include "google/protobuf/compiler/java/generator_common.h"
 #include "google/protobuf/compiler/java/helpers.h"
-#include "google/protobuf/compiler/java/full/field_generator.h"
-#include "google/protobuf/compiler/java/full/make_field_gens.h"
-#include "google/protobuf/compiler/java/lite/field_generator.h"
-#include "google/protobuf/compiler/java/lite/make_field_gens.h"
 #include "google/protobuf/compiler/java/name_resolver.h"
+#include "google/protobuf/compiler/kotlin/field.h"
 #include "google/protobuf/io/printer.h"
 
 // Must be last.
@@ -39,36 +38,17 @@
       lite_(!java::HasDescriptorMethods(descriptor_->file(),
                                         context->EnforceLite())),
       jvm_dsl_(!lite_ || context->options().jvm_dsl),
-      lite_field_generators_(
-          java::FieldGeneratorMap<java::ImmutableFieldLiteGenerator>(
-              descriptor_)),
-      field_generators_(
-          java::FieldGeneratorMap<java::ImmutableFieldGenerator>(descriptor_)) {
+      field_generators_(java::FieldGeneratorMap<FieldGenerator>(descriptor_)) {
   for (int i = 0; i < descriptor_->field_count(); i++) {
     if (java::IsRealOneof(descriptor_->field(i))) {
       const OneofDescriptor* oneof = descriptor_->field(i)->containing_oneof();
       ABSL_CHECK(oneofs_.emplace(oneof->index(), oneof).first->second == oneof);
     }
   }
-  if (lite_) {
-    lite_field_generators_ =
-        java::MakeImmutableFieldLiteGenerators(descriptor_, context_);
-  } else {
-    field_generators_ =
-        java::MakeImmutableFieldGenerators(descriptor_, context_);
-  }
-}
-
-void MessageGenerator::GenerateFieldMembers(io::Printer* printer) const {
   for (int i = 0; i < descriptor_->field_count(); i++) {
-    printer->Print("\n");
-    if (lite_) {
-      lite_field_generators_.get(descriptor_->field(i))
-          .GenerateKotlinDslMembers(printer);
-    } else {
-      field_generators_.get(descriptor_->field(i))
-          .GenerateKotlinDslMembers(printer);
-    }
+    const FieldDescriptor* field = descriptor->field(i);
+    auto generator = std::make_unique<FieldGenerator>(field, context_, lite_);
+    field_generators_.Add(field, std::move(generator));
   }
 }
 
@@ -97,7 +77,10 @@
 
   printer->Indent();
 
-  GenerateFieldMembers(printer);
+  for (int i = 0; i < descriptor_->field_count(); i++) {
+    printer->Print("\n");
+    field_generators_.get(descriptor_->field(i)).Generate(printer);
+  }
 
   for (auto& kv : oneofs_) {
     java::JvmNameContext name_ctx = {context_->options(), printer, lite_};
diff --git a/src/google/protobuf/compiler/kotlin/message.h b/src/google/protobuf/compiler/kotlin/message.h
index 28bb428..9c10476 100644
--- a/src/google/protobuf/compiler/kotlin/message.h
+++ b/src/google/protobuf/compiler/kotlin/message.h
@@ -11,9 +11,8 @@
 #include "absl/container/btree_map.h"
 #include "google/protobuf/compiler/java/context.h"
 #include "google/protobuf/compiler/java/generator_common.h"
-#include "google/protobuf/compiler/java/full/field_generator.h"
-#include "google/protobuf/compiler/java/lite/field_generator.h"
 #include "google/protobuf/compiler/java/name_resolver.h"
+#include "google/protobuf/compiler/kotlin/field.h"
 #include "google/protobuf/descriptor.h"
 
 namespace google {
@@ -40,11 +39,7 @@
   bool lite_;
   bool jvm_dsl_;
 
-  // TODO: b/366047913 - These can be simplified once lite and full field
-  // generators are unified.
-  java::FieldGeneratorMap<java::ImmutableFieldLiteGenerator>
-      lite_field_generators_;
-  java::FieldGeneratorMap<java::ImmutableFieldGenerator> field_generators_;
+  java::FieldGeneratorMap<FieldGenerator> field_generators_;
 
   void GenerateExtensions(io::Printer* printer) const;
   void GenerateOrNull(io::Printer* printer) const;