本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.TypeCompilationState.GenerateTempNumber方法的典型用法代码示例。如果您正苦于以下问题:C# TypeCompilationState.GenerateTempNumber方法的具体用法?C# TypeCompilationState.GenerateTempNumber怎么用?C# TypeCompilationState.GenerateTempNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.TypeCompilationState
的用法示例。
在下文中一共展示了TypeCompilationState.GenerateTempNumber方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SynthesizedLambdaMethod
internal SynthesizedLambdaMethod(NamedTypeSymbol containingType, MethodSymbol topLevelMethod, BoundLambda node, bool isStatic, TypeCompilationState compilationState)
: base(containingType,
node.Symbol,
null,
node.SyntaxTree.GetReference(node.Body.Syntax),
node.Syntax.GetLocation(),
GeneratedNames.MakeLambdaMethodName(topLevelMethod.Name, compilationState.GenerateTempNumber()),
(containingType is LambdaFrame ? DeclarationModifiers.Internal : DeclarationModifiers.Private)
| (isStatic ? DeclarationModifiers.Static : 0)
| (node.Symbol.IsAsync ? DeclarationModifiers.Async : 0))
{
TypeMap typeMap;
ImmutableArray<TypeParameterSymbol> typeParameters;
LambdaFrame lambdaFrame;
if (!topLevelMethod.IsGenericMethod)
{
typeMap = TypeMap.Empty;
typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
}
else if ((object)(lambdaFrame = this.ContainingType as LambdaFrame) != null)
{
typeMap = lambdaFrame.TypeMap;
typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
}
else
{
typeMap = TypeMap.Empty.WithAlphaRename(topLevelMethod, this, out typeParameters);
}
AssignTypeMapAndTypeParameters(typeMap, typeParameters);
}
示例2: AsyncStruct
public AsyncStruct(MethodSymbol method, TypeCompilationState compilationState)
: base(method, GeneratedNames.MakeIteratorOrAsyncDisplayClassName(method.Name, compilationState.GenerateTempNumber()), TypeKind.Struct)
{
this.interfaces = ReadOnlyArray<NamedTypeSymbol>.CreateFrom(
compilationState.EmitModule.Compilation.GetWellKnownType(WellKnownType.System_Runtime_CompilerServices_IAsyncStateMachine));
this.constructor = new SynthesizedInstanceConstructor(this);
}
示例3: IteratorClass
public IteratorClass(MethodSymbol method, bool isEnumerable, TypeSymbol elementType, TypeCompilationState compilationState)
: base(method, GeneratedNames.MakeIteratorOrAsyncDisplayClassName(method.Name, compilationState.GenerateTempNumber()), TypeKind.Class)
{
this.ElementType = TypeMap.SubstituteType(elementType);
var interfaces = ArrayBuilder<NamedTypeSymbol>.GetInstance();
if (isEnumerable)
{
interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T).Construct(ElementType));
interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_IEnumerable));
}
interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerator_T).Construct(ElementType));
interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_IDisposable));
interfaces.Add(ContainingAssembly.GetSpecialType(SpecialType.System_Collections_IEnumerator));
this.interfaces = interfaces.ToImmutableAndFree();
this.constructor = new IteratorConstructor(this);
}
示例4: LambdaFrameLocalSymbol
internal LambdaFrameLocalSymbol(MethodSymbol containingMethod, TypeSymbol type, TypeCompilationState compilationState)
: base(containingMethod, type, GeneratedNames.MakeLambdaDisplayClassLocalName(compilationState.GenerateTempNumber()), declarationKind: LocalDeclarationKind.CompilerGeneratedLambdaDisplayClassLocal)
{
}
示例5: LambdaFrame
internal LambdaFrame(MethodSymbol topLevelMethod, TypeCompilationState compilationState)
: base(topLevelMethod, GeneratedNames.MakeAnonymousDisplayClassName(compilationState.GenerateTempNumber()), TypeKind.Class)
{
this.constructor = new SynthesizedInstanceConstructor(this);
}
示例6: LambdaFrame
internal LambdaFrame(MethodSymbol topLevelMethod, TypeCompilationState compilationState)
: base(GeneratedNames.MakeAnonymousDisplayClassName(compilationState.GenerateTempNumber()), topLevelMethod)
{
this.topLevelMethod = topLevelMethod;
this.constructor = new LambdaFrameConstructor(this);
}