Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mavasani committed Dec 8, 2022
1 parent 6629a58 commit 3b84a3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Utilities/Compiler/Extensions/IOperationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,9 @@ public static IOperation WalkDownConversion(this IOperation operation, Func<ICon
var thrownObject = operation.Exception;

// Starting C# 8.0, C# compiler wraps the thrown operation within an implicit conversion to System.Exception type.
// We also want to walk down explicit conversions such as "throw (Exception)new ArgumentNullException())".
if (thrownObject is IConversionOperation conversion &&
conversion.IsImplicit)
conversion.Conversion.Exists)
{
thrownObject = conversion.Operand;
}
Expand Down

0 comments on commit 3b84a3d

Please sign in to comment.