提交 996b247e 编写于 作者: C Chris Sienkiewicz

Rename ForeachEnumeratorInfo builder field to match immutable info

上级 7e0ca72d
......@@ -87,7 +87,7 @@ internal struct Builder
public MethodSymbol CurrentPropertyGetter;
public MethodSymbol MoveNextMethod;
public bool NeedsDisposeMethod;
public bool NeedsDisposal;
public AwaitableInfo DisposeAwaitableInfo;
public MethodSymbol DisposeMethod;
......@@ -110,7 +110,7 @@ public ForEachEnumeratorInfo Build(BinderFlags location)
GetEnumeratorMethod,
CurrentPropertyGetter,
MoveNextMethod,
NeedsDisposeMethod,
NeedsDisposal,
DisposeAwaitableInfo,
DisposeMethod,
CollectionConversion,
......
......@@ -479,7 +479,7 @@ private BoundForEachStatement BindForEachPartsWorker(DiagnosticBag diagnostics,
ConstantValue.NotAvailable,
builder.CollectionType);
if (builder.NeedsDisposeMethod && IsAsync)
if (builder.NeedsDisposal && IsAsync)
{
hasErrors |= GetAwaitDisposeAsyncInfo(ref builder, diagnostics);
}
......@@ -808,7 +808,7 @@ private EnumeratorResult GetEnumeratorInfo(ref ForEachEnumeratorInfo.Builder bui
}
// We don't know the runtime type, so we will have to insert a runtime check for IDisposable (with a conditional call to IDisposable.Dispose).
builder.NeedsDisposeMethod = true;
builder.NeedsDisposal = true;
return EnumeratorResult.Succeeded;
}
......@@ -841,7 +841,7 @@ private void GetDisposalInfoForEnumerator(ref ForEachEnumeratorInfo.Builder buil
isAsync ? this.Compilation.GetWellKnownType(WellKnownType.System_IAsyncDisposable) : this.Compilation.GetSpecialType(SpecialType.System_IDisposable),
ref useSiteDiagnostics).IsImplicit)
{
builder.NeedsDisposeMethod = true;
builder.NeedsDisposal = true;
}
else if (enumeratorType.IsRefLikeType)
{
......@@ -852,7 +852,7 @@ private void GetDisposalInfoForEnumerator(ref ForEachEnumeratorInfo.Builder buil
MethodSymbol disposeMethod = TryFindDisposePatternMethod(receiver, _syntax, isAsync, patternDisposeDiags);
if (!(disposeMethod is null))
{
builder.NeedsDisposeMethod = true;
builder.NeedsDisposal = true;
builder.DisposeMethod = disposeMethod;
}
patternDisposeDiags.Free();
......@@ -910,7 +910,7 @@ private ForEachEnumeratorInfo.Builder GetDefaultEnumeratorInfo(ForEachEnumerator
TypeSymbol.Equals(builder.GetEnumeratorMethod.ReturnType.TypeSymbol, this.Compilation.GetSpecialType(SpecialType.System_Collections_IEnumerator), TypeCompareKind.ConsiderEverything2));
// We don't know the runtime type, so we will have to insert a runtime check for IDisposable (with a conditional call to IDisposable.Dispose).
builder.NeedsDisposeMethod = true;
builder.NeedsDisposal = true;
return builder;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册