Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address feedback
  • Loading branch information
mavasani committed Dec 8, 2022
commit 3b84a3dc04789768d8acc3f596d87f9461086ca3
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