From 4f3e2da7c00e3dc7c921aa146eb8ce645ebf2b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Tue, 15 Aug 2023 08:39:14 +0200 Subject: [PATCH] Document why we add the prefix --- protoc_plugin/lib/src/message_generator.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/protoc_plugin/lib/src/message_generator.dart b/protoc_plugin/lib/src/message_generator.dart index 5e79b96b6..95963d55e 100644 --- a/protoc_plugin/lib/src/message_generator.dart +++ b/protoc_plugin/lib/src/message_generator.dart @@ -445,6 +445,7 @@ class MessageGenerator extends ProtobufContainer { } } out.println('}) {'); + // Add '$' prefix to avoid proto field name conflicts. out.println(' final \$result = create();'); for (final field in _fieldList) { out.println(' if (${field.memberNames!.fieldName} != null) {');