From 76227a7c9afe0d398621240c602b542361926fdf Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Thu, 9 Nov 2023 00:02:38 +0100 Subject: [PATCH] fix --- .../baboon/translator/csharp/CSUEBACodecGenerator.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/io/septimalmind/baboon/translator/csharp/CSUEBACodecGenerator.scala b/src/main/scala/io/septimalmind/baboon/translator/csharp/CSUEBACodecGenerator.scala index ad30242..698ad95 100644 --- a/src/main/scala/io/septimalmind/baboon/translator/csharp/CSUEBACodecGenerator.scala +++ b/src/main/scala/io/septimalmind/baboon/translator/csharp/CSUEBACodecGenerator.scala @@ -64,11 +64,12 @@ class CSUEBACodecGenerator(trans: CSTypeTranslator, tools: CSDefnTools) val branchName = m.name.name val fqBranch = q"$branchNs.$branchName" val cName = codecName(trans.toCsVal(m, version)) + val castedName = branchName.toLowerCase - (q"""if (value is $fqBranch cvalue) + (q"""if (value is $fqBranch $castedName) |{ | writer.Write((byte)${idx.toString}); - | $cName.Instance.Encode(writer, cvalue); + | $cName.Instance.Encode(writer, $castedName); | return; |}""".stripMargin, q"""if (asByte == ${idx.toString}) |{