From d20dadf43323419df953b2ad8ae26c12e13ccb45 Mon Sep 17 00:00:00 2001 From: carlosmiei <43336371+carlosmiei@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:16:57 +0100 Subject: [PATCH] update --- src/csharpTranspiler.ts | 2 +- tests/csharpTranspiler.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/csharpTranspiler.ts b/src/csharpTranspiler.ts index 6a84fd7..8bbc4e8 100644 --- a/src/csharpTranspiler.ts +++ b/src/csharpTranspiler.ts @@ -886,7 +886,7 @@ export class CSharpTranspiler extends BaseTranspiler { } printConcatCall(node, identation, name = undefined, parsedArg = undefined) { - return `${name}.Concat(${parsedArg}).ToList()`; + return `((string)${name}).Concat(${parsedArg}).ToList()`; } printToFixedCall(node, identation, name = undefined, parsedArg = undefined) { diff --git a/tests/csharpTranspiler.test.ts b/tests/csharpTranspiler.test.ts index b92d9f7..6870f52 100644 --- a/tests/csharpTranspiler.test.ts +++ b/tests/csharpTranspiler.test.ts @@ -931,7 +931,7 @@ describe('csharp transpiling tests', () => { }); test('should convert concat', () => { const ts = "y.concat(z)"; - const result = "y.Concat(x).ToList()"; + const result = "((string)y).Concat(x).ToList()"; const output = transpiler.transpileCSharp(ts).content; expect(output).toBe(result); });