108 lines
3.4 KiB
C#
108 lines
3.4 KiB
C#
using Microsoft.CodeAnalysis.CSharp.Symbols;
|
|
|
|
namespace Microsoft.CodeAnalysis.CSharp;
|
|
|
|
internal sealed class ForEachEnumeratorInfo
|
|
{
|
|
internal struct Builder
|
|
{
|
|
public TypeSymbol CollectionType;
|
|
|
|
public bool ViaExtensionMethod;
|
|
|
|
public WellKnownType InlineArraySpanType;
|
|
|
|
public bool InlineArrayUsedAsValue;
|
|
|
|
public TypeWithAnnotations ElementTypeWithAnnotations;
|
|
|
|
public MethodArgumentInfo? GetEnumeratorInfo;
|
|
|
|
public MethodSymbol CurrentPropertyGetter;
|
|
|
|
public MethodArgumentInfo? MoveNextInfo;
|
|
|
|
public bool IsAsync;
|
|
|
|
public bool NeedsDisposal;
|
|
|
|
public BoundAwaitableInfo? DisposeAwaitableInfo;
|
|
|
|
public MethodArgumentInfo? PatternDisposeInfo;
|
|
|
|
public BoundValuePlaceholder? CurrentPlaceholder;
|
|
|
|
public BoundExpression? CurrentConversion;
|
|
|
|
public TypeSymbol ElementType => ElementTypeWithAnnotations.Type;
|
|
|
|
public bool IsIncomplete
|
|
{
|
|
get
|
|
{
|
|
if ((object)GetEnumeratorInfo != null && (object)MoveNextInfo != null)
|
|
{
|
|
return (object)CurrentPropertyGetter == null;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public ForEachEnumeratorInfo Build(BinderFlags location)
|
|
{
|
|
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
|
|
return new ForEachEnumeratorInfo(CollectionType, InlineArraySpanType, InlineArrayUsedAsValue, ElementTypeWithAnnotations, GetEnumeratorInfo, CurrentPropertyGetter, MoveNextInfo, IsAsync, NeedsDisposal, DisposeAwaitableInfo, PatternDisposeInfo, CurrentPlaceholder, CurrentConversion, location);
|
|
}
|
|
}
|
|
|
|
public readonly TypeSymbol CollectionType;
|
|
|
|
public readonly WellKnownType InlineArraySpanType;
|
|
|
|
public readonly bool InlineArrayUsedAsValue;
|
|
|
|
public readonly TypeWithAnnotations ElementTypeWithAnnotations;
|
|
|
|
public readonly MethodArgumentInfo GetEnumeratorInfo;
|
|
|
|
public readonly MethodSymbol CurrentPropertyGetter;
|
|
|
|
public readonly MethodArgumentInfo MoveNextInfo;
|
|
|
|
public readonly bool NeedsDisposal;
|
|
|
|
public readonly bool IsAsync;
|
|
|
|
public readonly BoundAwaitableInfo? DisposeAwaitableInfo;
|
|
|
|
public readonly MethodArgumentInfo? PatternDisposeInfo;
|
|
|
|
public readonly BoundValuePlaceholder? CurrentPlaceholder;
|
|
|
|
public readonly BoundExpression? CurrentConversion;
|
|
|
|
public readonly BinderFlags Location;
|
|
|
|
public TypeSymbol ElementType => ElementTypeWithAnnotations.Type;
|
|
|
|
private ForEachEnumeratorInfo(TypeSymbol collectionType, WellKnownType inlineArraySpanType, bool inlineArrayUsedAsValue, TypeWithAnnotations elementType, MethodArgumentInfo getEnumeratorInfo, MethodSymbol currentPropertyGetter, MethodArgumentInfo moveNextInfo, bool isAsync, bool needsDisposal, BoundAwaitableInfo? disposeAwaitableInfo, MethodArgumentInfo? patternDisposeInfo, BoundValuePlaceholder? currentPlaceholder, BoundExpression? currentConversion, BinderFlags location)
|
|
{
|
|
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
|
|
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
|
|
CollectionType = collectionType;
|
|
InlineArraySpanType = inlineArraySpanType;
|
|
InlineArrayUsedAsValue = inlineArrayUsedAsValue;
|
|
ElementTypeWithAnnotations = elementType;
|
|
GetEnumeratorInfo = getEnumeratorInfo;
|
|
CurrentPropertyGetter = currentPropertyGetter;
|
|
MoveNextInfo = moveNextInfo;
|
|
IsAsync = isAsync;
|
|
NeedsDisposal = needsDisposal;
|
|
DisposeAwaitableInfo = disposeAwaitableInfo;
|
|
PatternDisposeInfo = patternDisposeInfo;
|
|
CurrentPlaceholder = currentPlaceholder;
|
|
CurrentConversion = currentConversion;
|
|
Location = location;
|
|
}
|
|
}
|