From 1b432f47ffe43954d117d84f980c98f066011b7b Mon Sep 17 00:00:00 2001 From: Alexandru Oltean <49864209+aoltean16@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:01:17 +0300 Subject: [PATCH] Fix string array of array (#341) --- src/Test/TestCases.Workflows/XamlTests.cs | 4 ++++ src/UiPath.Workflow/Activities/ExpressionCompiler.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Test/TestCases.Workflows/XamlTests.cs b/src/Test/TestCases.Workflows/XamlTests.cs index 77447780..e73a181d 100644 --- a/src/Test/TestCases.Workflows/XamlTests.cs +++ b/src/Test/TestCases.Workflows/XamlTests.cs @@ -276,6 +276,8 @@ public async Task VB_CreatePrecompiedValueAsync_ProperlyIdentifiesVariables() [InlineData(typeof(Func), "Function() (1 + 1)", true)] [InlineData(typeof(Func), "Function() (Nothing)", false)] [InlineData(typeof(Func), "Function() (\"test\")", false)] + [InlineData(typeof(string[][]), "Nothing", false)] + [InlineData(typeof(string[][][][]), "Nothing", false)] public async Task VB_CreatePrecompiedValueAsync_CorrectReturnType(Type targetType, string expressionText, bool shouldExpectError) { var location = new ActivityLocationReferenceEnvironment(); @@ -305,6 +307,8 @@ public async Task VB_CreatePrecompiedValueAsync_CorrectReturnType(Type targetTyp [InlineData(typeof(Func), "() => null", false)] [InlineData(typeof(Func), "() => 1 + 1", true)] [InlineData(typeof(Func), "() => \"test\"", false)] + [InlineData(typeof(string[][]), "default", false)] + [InlineData(typeof(string[][][][]), "default", false)] public async Task CS_CreatePrecompiedValueAsync_CorrectReturnType(Type targetType, string expressionText, bool shouldExpectError) { var location = new ActivityLocationReferenceEnvironment(); diff --git a/src/UiPath.Workflow/Activities/ExpressionCompiler.cs b/src/UiPath.Workflow/Activities/ExpressionCompiler.cs index 21b39614..f7c5c7b1 100644 --- a/src/UiPath.Workflow/Activities/ExpressionCompiler.cs +++ b/src/UiPath.Workflow/Activities/ExpressionCompiler.cs @@ -24,7 +24,7 @@ protected static Assembly GetAssemblyForType(ITypeSymbol type) { if (type is IArrayTypeSymbol arrayTypeSymbol) { - return AssemblyReference.GetAssembly(new AssemblyName(arrayTypeSymbol.ElementType.ContainingAssembly.Name)); + return AssemblyReference.GetAssembly(new AssemblyName(GetAssemblyForType(arrayTypeSymbol.ElementType).GetName().Name)); } else {