-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's only required until dotnet/roslyn#71115 is fixed. (cherry picked from commit b0a64e6)
- Loading branch information
1 parent
ffa0ed6
commit db071f5
Showing
3 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace ICSharpCode.CodeConverter.CSharp; | ||
internal static class DataFlowAnalysisExtensions | ||
{ | ||
/// <summary> | ||
/// Accesses the <see cref="DataFlowAnalysis.ReadInside" /> second time in case of exception. | ||
/// This is a workaround for a bug present in Roslyn up to version 4.8.0 | ||
/// (https://github.com/dotnet/roslyn/issues/71115) | ||
/// </summary> | ||
public static System.Collections.Immutable.ImmutableArray<ISymbol> ReadInsideSafe(this DataFlowAnalysis dataFlow) | ||
{ | ||
try | ||
{ | ||
return dataFlow.ReadInside; | ||
} | ||
catch | ||
{ | ||
return dataFlow.ReadInside; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters