Fix small issues in member semantic model.

上级 44f672fd
......@@ -1825,9 +1825,10 @@ private void EnsureRootBoundForNullabilityIfNecessary()
#endif
}
var bindableRoot = GetBindableSyntaxNode(Root);
using var upgradeableLock = _nodeMapLock.DisposableUpgradeableRead();
if (_guardedNodeMap.ContainsKey(Root)
if (_guardedNodeMap.ContainsKey(bindableRoot)
#if DEBUG
// In DEBUG mode, we don't want to increase test run times, so if
// nullable analysis isn't enabled and some node has already been bound
......@@ -1848,11 +1849,11 @@ private void EnsureRootBoundForNullabilityIfNecessary()
// then take that state and run analysis on the statement or expression being speculated on.
// Currently, it will return incorrect info because it's just running analysis on the speculated
// part.
var binder = GetEnclosingBinder(GetAdjustedNodePosition(GetBindableSyntaxNode(Root)));
var boundRoot = Bind(binder, Root, diagnostics);
var binder = GetEnclosingBinder(GetAdjustedNodePosition(bindableRoot);
var boundRoot = Bind(binder, bindableRoot, diagnostics);
boundRoot = RewriteNullableBoundNodes(boundRoot, binder.Conversions, diagnostics);
if (EnableNullableAnalysis)
if (EnableNullableAnalysis && !IsSpeculativeSemanticModel)
{
GuardedAddBoundTreeForStandaloneSyntax(Root, boundRoot);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册