From 966a1ffdc3ceda9d52ba01129c79774be6f0431c Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 14 Jan 2020 17:12:46 -0800 Subject: [PATCH] Add comments --- .../Portable/Extensions/ExpressionSyntaxExtensions.cs | 6 ++++++ .../Portable/Extensions/ExpressionSyntaxExtensions.vb | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/Workspaces/CSharp/Portable/Extensions/ExpressionSyntaxExtensions.cs b/src/Workspaces/CSharp/Portable/Extensions/ExpressionSyntaxExtensions.cs index ba410f92815..1307956b1fb 100644 --- a/src/Workspaces/CSharp/Portable/Extensions/ExpressionSyntaxExtensions.cs +++ b/src/Workspaces/CSharp/Portable/Extensions/ExpressionSyntaxExtensions.cs @@ -815,6 +815,12 @@ private static bool CanReplace(ISymbol symbol) return true; } + // See https://github.com/dotnet/roslyn/issues/40974 + // + // To be very safe, we only support simplifying code that bound to a symbol without any + // sort of problems. We could potentially relax this in the future. However, we would + // need to be very careful about the implications of us offering to fixup 'broken' code + // in a manner that might end up making things worse or confusing the user. var symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, memberAccess); if (symbol == null) return false; diff --git a/src/Workspaces/VisualBasic/Portable/Extensions/ExpressionSyntaxExtensions.vb b/src/Workspaces/VisualBasic/Portable/Extensions/ExpressionSyntaxExtensions.vb index 323446229b8..99ee8721d44 100644 --- a/src/Workspaces/VisualBasic/Portable/Extensions/ExpressionSyntaxExtensions.vb +++ b/src/Workspaces/VisualBasic/Portable/Extensions/ExpressionSyntaxExtensions.vb @@ -979,6 +979,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.Extensions Return True End If + ' See https//github.com/dotnet/roslyn/issues/40974 + ' + ' To be very safe, we only support simplifying code that bound to a symbol without any + ' sort of problems. We could potentially relax this in the future. However, we would + ' need to be very careful about the implications of us offering to fixup 'broken' code + ' in a manner that might end up making things worse Or confusing the user. Dim symbol = SimplificationHelpers.GetOriginalSymbolInfo(semanticModel, memberAccess) If symbol Is Nothing Then Return False -- GitLab