提交 74461534 编写于 作者: M Manish Vasani

Merge pull request #1082 from mavasani/Issue1025

Fixes #1025 : Replace '!=' check for comparing symbols in AbstractSpeculationAnalyzer with SymbolsAreCompatible check, which basically uses Equals method for comparison. This was causing two equivalent symbols across semantic model and it's speculative model to be reported as incompatible, causing all simplifications to bail out for ?. expression in VB.
......@@ -3864,7 +3864,8 @@ End Class
Test(code, expected, compareTokens:=False)
End Sub
<Fact(Skip:="https://github.com/dotnet/roslyn/issues/1025"), Trait(Traits.Feature, Traits.Features.CodeActionsInlineTemporary)>
<WorkItem(1025, "https://github.com/dotnet/roslyn/issues/1025")>
<Fact, Trait(Traits.Feature, Traits.Features.CodeActionsInlineTemporary)>
Public Sub TestConditionalAccessWithConversion()
Dim code =
<File>
......
......@@ -735,15 +735,8 @@ private bool ReplacementBreaksInvocableExpression(TExpressionSyntax expression,
if (originalTargetType != null)
{
var newTargetType = this.SpeculativeSemanticModel.GetTypeInfo(newLeft).Type;
if (originalTargetType != newTargetType)
{
return true;
}
if (!ImplicitConversionsAreCompatible(originalRight, originalTargetType, newRight, newTargetType))
{
return true;
}
return !SymbolsAreCompatible(originalTargetType, newTargetType) ||
!ImplicitConversionsAreCompatible(originalRight, originalTargetType, newRight, newTargetType);
}
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册