Skip to content

Commit

Permalink
Test for case similar to #782
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamTheCoder committed Feb 12, 2024
1 parent 8b22bc2 commit de43c73
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Tests/CSharp/ExpressionTests/ExpressionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,25 @@ public void S()
}");
}

[Fact]
public async Task DynamicBoolAsync()
{
await TestConversionVisualBasicToCSharpAsync(@"
Public Class C
Public Function IsHybridApp() As Boolean
Return New Object().Session(""hybrid"") IsNot Nothing AndAlso New Object().Session(""hybrid"") = 1
End Function
End Class", @"using Microsoft.VisualBasic.CompilerServices; // Install-Package Microsoft.VisualBasic
public partial class C
{
public bool IsHybridApp()
{
return Conversions.ToBoolean(((dynamic)new object()).Session(""hybrid"") is not null && Operators.ConditionalCompareObjectEqual(((dynamic)new object()).Session(""hybrid""), 1, false));
}
}");
}

[Fact]
public async Task ConversionOfNotUsesParensIfNeededAsync()
{
Expand Down

0 comments on commit de43c73

Please sign in to comment.