Skip to content

Commit

Permalink
Fix string array of array (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
aoltean16 authored Oct 15, 2024
1 parent 41bcbd6 commit 1b432f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Test/TestCases.Workflows/XamlTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ public async Task VB_CreatePrecompiedValueAsync_ProperlyIdentifiesVariables()
[InlineData(typeof(Func<string>), "Function() (1 + 1)", true)]
[InlineData(typeof(Func<string>), "Function() (Nothing)", false)]
[InlineData(typeof(Func<string>), "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();
Expand Down Expand Up @@ -305,6 +307,8 @@ public async Task VB_CreatePrecompiedValueAsync_CorrectReturnType(Type targetTyp
[InlineData(typeof(Func<string>), "() => null", false)]
[InlineData(typeof(Func<string>), "() => 1 + 1", true)]
[InlineData(typeof(Func<string>), "() => \"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();
Expand Down
2 changes: 1 addition & 1 deletion src/UiPath.Workflow/Activities/ExpressionCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit 1b432f4

Please sign in to comment.