From f73f19f71f056c1d5ed8a2677a3a8221dc6394da Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Sun, 29 Mar 2020 23:41:59 -0700 Subject: [PATCH] Add docs --- .../Compiler/Core/Utilities/AbstractSpeculationAnalyzer.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/AbstractSpeculationAnalyzer.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/AbstractSpeculationAnalyzer.cs index e07df118fc2..b12473751b3 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/AbstractSpeculationAnalyzer.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Utilities/AbstractSpeculationAnalyzer.cs @@ -858,9 +858,12 @@ private bool ReplacementBreaksExpression(TExpressionSyntax expression, TExpressi if (newReceiverType.IsValueType) { + // Presume builtin value types are all immutable, and thus will have the same semantics when you call + // interface members on them directly instead of through a boxed copy. if (newReceiverType.SpecialType != SpecialType.None) return true; + // For non-builtins, only remove the boxing if we know we have a copy already. return newReceiver != null && IsReceiverUniqueInstance(newReceiver, speculativeSemanticModel); } -- GitLab