• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AssemblySymbol类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AssemblySymbol的典型用法代码示例。如果您正苦于以下问题:C# AssemblySymbol类的具体用法?C# AssemblySymbol怎么用?C# AssemblySymbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AssemblySymbol类属于命名空间,在下文中一共展示了AssemblySymbol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CopyTypeCustomModifiers

        /// <param name="sourceType">Type that already has custom modifiers.</param>
        /// <param name="destinationType">Same as <paramref name="sourceType"/>, but without custom modifiers.  May differ in object/dynamic.</param>
        /// <param name="refKind"><see cref="RefKind"/> of the parameter of which this is the type (or <see cref="RefKind.None"/> for a return type.</param>
        /// <param name="containingAssembly">The assembly containing the signature referring to the destination type.</param>
        /// <returns><paramref name="destinationType"/> with custom modifiers copied from <paramref name="sourceType"/>.</returns>
        internal static TypeSymbol CopyTypeCustomModifiers(TypeSymbol sourceType, TypeSymbol destinationType, RefKind refKind, AssemblySymbol containingAssembly)
        {
            Debug.Assert(sourceType.Equals(destinationType, TypeCompareKind.AllIgnoreOptions));

            // NOTE: overrides can differ by object/dynamic.  If they do, we'll need to tweak newType before
            // we can use it in place of this.Type.  We do so by computing the dynamic transform flags that
            // code gen uses and then passing them to the dynamic type decoder that metadata reading uses.
            ImmutableArray<bool> flags = CSharpCompilation.DynamicTransformsEncoder.EncodeWithoutCustomModifierFlags(destinationType, refKind);
            TypeSymbol typeWithDynamic = DynamicTypeDecoder.TransformTypeWithoutCustomModifierFlags(sourceType, containingAssembly, refKind, flags);

            TypeSymbol resultType;
            if (destinationType.ContainsTuple() && !sourceType.Equals(destinationType, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreDynamic))
            {
                // We also preserve tuple names, if present and different
                ImmutableArray<string> names = CSharpCompilation.TupleNamesEncoder.Encode(destinationType);
                resultType = TupleTypeDecoder.DecodeTupleTypesIfApplicable(typeWithDynamic, containingAssembly, names);
            }
            else
            {
                resultType = typeWithDynamic;
            }

            Debug.Assert(resultType.Equals(sourceType, TypeCompareKind.IgnoreDynamicAndTupleNames)); // Same custom modifiers as source type.
            Debug.Assert(resultType.Equals(destinationType, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds)); // Same object/dynamic and tuple names as destination type.
            return resultType;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:31,代码来源:CustomModifierUtils.cs


示例2: SetCorLibrary

        /// <summary>
        /// A helper method for AssemblyManager to set the system assembly, which provides primitive 
        /// types like Object, String, etc., think mscorlib.dll. 
        /// </summary>
        /// <param name="corLibrary"></param>
        internal void SetCorLibrary(
            AssemblySymbol corLibrary)
        {
            Contract.ThrowIfNull(referencedAssemblies);
            Contract.ThrowIfNull(referencedAssemblySymbols);

            if (corLibrary != null && !ReferenceEquals(corLibrary, this.ContainingAssembly))
            {
                bool corLibraryIsOk = false;

                foreach (var asm in referencedAssemblySymbols)
                {
                    if (object.ReferenceEquals(asm, corLibrary))
                    {
                        corLibraryIsOk = true;
                        break;
                    }
                }

                Contract.ThrowIfFalse(corLibraryIsOk);
            }

            System.Diagnostics.Debug.Assert(coreLibrary == null);
            coreLibrary = corLibrary;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:30,代码来源:MetadataOrSourceModuleSymbol.cs


示例3: ResolveBounds

        /// <summary>
        /// Determine the effective base type, effective interface set, and set of type
        /// parameters (excluding cycles) from the type parameter constraints. Conflicts
        /// within the constraints and constraint types are returned as diagnostics.
        /// 'inherited' should be true if the type parameters are from an overridden
        /// generic method. In those cases, additional constraint checks are applied.
        /// </summary>
        public static TypeParameterBounds ResolveBounds(
            this TypeParameterSymbol typeParameter,
            AssemblySymbol corLibrary,
            ConsList<TypeParameterSymbol> inProgress,
            ImmutableArray<TypeSymbol> constraintTypes,
            bool inherited,
            CSharpCompilation currentCompilation,
            DiagnosticBag diagnostics)
        {
            var diagnosticsBuilder = ArrayBuilder<TypeParameterDiagnosticInfo>.GetInstance();
            ArrayBuilder<TypeParameterDiagnosticInfo> useSiteDiagnosticsBuilder = null;
            var bounds = typeParameter.ResolveBounds(corLibrary, inProgress, constraintTypes, inherited, currentCompilation, diagnosticsBuilder, ref useSiteDiagnosticsBuilder);

            if (useSiteDiagnosticsBuilder != null)
            {
                diagnosticsBuilder.AddRange(useSiteDiagnosticsBuilder);
            }

            foreach (var pair in diagnosticsBuilder)
            {
                diagnostics.Add(new CSDiagnostic(pair.DiagnosticInfo, pair.TypeParameter.Locations[0]));
            }

            diagnosticsBuilder.Free();
            return bounds;
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:33,代码来源:ConstraintsHelper.cs


示例4: TransformTypeInternal

        private static TypeSymbol TransformTypeInternal(
            TypeSymbol metadataType,
            AssemblySymbol containingAssembly,
            int targetSymbolCustomModifierCount,
            RefKind targetSymbolRefKind,
            ImmutableArray<bool> dynamicTransformFlags,
            bool haveCustomModifierFlags)
        {
            Debug.Assert((object)metadataType != null);
            Debug.Assert((object)containingAssembly != null);
            Debug.Assert(!dynamicTransformFlags.IsDefault);

            if (dynamicTransformFlags.Length == 0)
            {
                return new UnsupportedMetadataTypeSymbol();
            }

            var decoder = new DynamicTypeDecoder(dynamicTransformFlags, haveCustomModifierFlags, containingAssembly);

            // Native compiler encodes bools (always false) for custom modifiers and parameter ref-kinds, if ref-kind is ref or out.
            if (decoder.HandleCustomModifiers(targetSymbolCustomModifierCount) && decoder.HandleParameterRefKind(targetSymbolRefKind))
            {
                TypeSymbol transformedType = decoder.TransformType(metadataType);

                if ((object)transformedType != null && decoder.index == dynamicTransformFlags.Length)
                {
                    return transformedType;
                }
            }

            // We ignore the dynamic transformation and return unchanged metadataType to match Dev11 behavior.
            return metadataType;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:33,代码来源:DynamicTypeDecoder.cs


示例5: CopyTypeCustomModifiers

        /// <param name="sourceType">Type that already has custom modifiers.</param>
        /// <param name="destinationType">Same as <paramref name="sourceType"/>, but without custom modifiers.  May differ in object/dynamic.</param>
        /// <param name="refKind"><see cref="RefKind"/> of the parameter of which this is the type (or <see cref="RefKind.None"/> for a return type.</param>
        /// <param name="containingAssembly">The assembly containing the signature referring to the destination type.</param>
        /// <returns><paramref name="destinationType"/> with custom modifiers copied from <paramref name="sourceType"/>.</returns>
        internal static TypeSymbol CopyTypeCustomModifiers(TypeSymbol sourceType, TypeSymbol destinationType, RefKind refKind, AssemblySymbol containingAssembly)
        {
            Debug.Assert(sourceType.Equals(destinationType, ignoreCustomModifiersAndArraySizesAndLowerBounds: true, ignoreDynamic: true));

            if (sourceType.ContainsTuple())
            {
                // TODO(https://github.com/dotnet/roslyn/issues/12389):
                // Need to save/restore tupleness as well
                if (sourceType.IsTupleType)
                {
                    Debug.Assert(destinationType.IsTupleType);
                    return destinationType;
                }

                ImmutableArray<bool> flags = CSharpCompilation.DynamicTransformsEncoder.EncodeWithoutCustomModifierFlags(destinationType, refKind);
                TypeSymbol resultType = DynamicTypeDecoder.TransformTypeWithoutCustomModifierFlags(sourceType, containingAssembly, refKind, flags);

                Debug.Assert(resultType.Equals(sourceType, ignoreCustomModifiersAndArraySizesAndLowerBounds: false, ignoreDynamic: true)); // Same custom modifiers as source type.
                return resultType;
            }
            else
            {
                // NOTE: overrides can differ by object/dynamic.  If they do, we'll need to tweak newType before
                // we can use it in place of this.Type.  We do so by computing the dynamic transform flags that
                // code gen uses and then passing them to the dynamic type decoder that metadata reading uses.
                ImmutableArray<bool> flags = CSharpCompilation.DynamicTransformsEncoder.EncodeWithoutCustomModifierFlags(destinationType, refKind);
                TypeSymbol resultType = DynamicTypeDecoder.TransformTypeWithoutCustomModifierFlags(sourceType, containingAssembly, refKind, flags);

                Debug.Assert(resultType.Equals(sourceType, ignoreCustomModifiersAndArraySizesAndLowerBounds: false, ignoreDynamic: true)); // Same custom modifiers as source type.
                Debug.Assert(resultType.Equals(destinationType, ignoreCustomModifiersAndArraySizesAndLowerBounds: true, ignoreDynamic: false)); // Same object/dynamic as destination type.
                return resultType;
            }
        }
开发者ID:xyh413,项目名称:roslyn,代码行数:38,代码来源:CustomModifierUtils.cs


示例6: IsSymbolAccessible

 /// <summary>
 /// Checks if 'symbol' is accessible from within assembly 'within'.  
 /// </summary>
 public static bool IsSymbolAccessible(
     Symbol symbol,
     AssemblySymbol within,
     ref HashSet<DiagnosticInfo> useSiteDiagnostics)
 {
     bool failedThroughTypeCheck;
     return IsSymbolAccessibleCore(symbol, within, null, out failedThroughTypeCheck, within.DeclaringCompilation, ref useSiteDiagnostics);
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:11,代码来源:AccessCheck.cs


示例7: UnifiedAssembly

        public UnifiedAssembly(AssemblySymbol targetAssembly, AssemblyIdentity originalReference)
        {
            Debug.Assert(originalReference != null);
            Debug.Assert(targetAssembly != null);

            this.OriginalReference = originalReference;
            this.TargetAssembly = targetAssembly;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:8,代码来源:UnifiedAssembly.cs


示例8: NoPiaAmbiguousCanonicalTypeSymbol

 public NoPiaAmbiguousCanonicalTypeSymbol(
     AssemblySymbol embeddingAssembly,
     NamedTypeSymbol firstCandidate,
     NamedTypeSymbol secondCandidate)
 {
     _embeddingAssembly = embeddingAssembly;
     _firstCandidate = firstCandidate;
     _secondCandidate = secondCandidate;
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:9,代码来源:NoPiaAmbiguousCanonicalTypeSymbol.cs


示例9: TransformTypeWithoutCustomModifierFlags

 internal static TypeSymbol TransformTypeWithoutCustomModifierFlags(
     TypeSymbol type,
     AssemblySymbol containingAssembly,
     RefKind targetSymbolRefKind,
     ImmutableArray<bool> dynamicTransformFlags)
 {
     Debug.Assert(containingAssembly is SourceAssemblySymbol); // Doesn't happen during decoding.
     return TransformTypeInternal(type, containingAssembly, 0, targetSymbolRefKind, dynamicTransformFlags, haveCustomModifierFlags: false);
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:9,代码来源:DynamicTypeDecoder.cs


示例10: SetReferences

        /// <summary>
        /// A helper method for AssemblyManager to set assembly identities for assemblies 
        /// referenced by this module and corresponding AssemblySymbols.
        /// </summary>
        /// <param name="names"></param>
        /// <param name="symbols"></param>
        internal override void SetReferences(
            System.Reflection.AssemblyName[] names,
            AssemblySymbol[] symbols)
        {
            base.SetReferences(names, symbols);

            System.Diagnostics.Debug.Assert(coreLibrary == null);
            coreLibrary = null;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:15,代码来源:MetadataOrSourceModuleSymbol.cs


示例11: MissingModuleSymbol

        public MissingModuleSymbol(AssemblySymbol assembly, int ordinal)
        {
            Debug.Assert((object)assembly != null);
            Debug.Assert(ordinal >= -1);

            this.assembly = assembly;
            this.ordinal = ordinal;
            globalNamespace = new MissingNamespaceSymbol(this);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:9,代码来源:MissingModuleSymbol.cs


示例12: DynamicTypeDecoder

        private DynamicTypeDecoder(ImmutableArray<bool> dynamicTransformFlags, bool haveCustomModifierFlags, AssemblySymbol containingAssembly)
        {
            Debug.Assert(!dynamicTransformFlags.IsEmpty);
            Debug.Assert((object)containingAssembly != null);

            this.dynamicTransformFlags = dynamicTransformFlags;
            this.containingAssembly = containingAssembly;
            this.haveCustomModifierFlags = haveCustomModifierFlags;
            this.index = 0;
        }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:10,代码来源:DynamicTypeDecoder.cs


示例13: DynamicTypeDecoder

        private DynamicTypeDecoder(ImmutableArray<bool> dynamicTransformFlags, bool haveCustomModifierFlags, bool checkLength, AssemblySymbol containingAssembly)
        {
            Debug.Assert(!dynamicTransformFlags.IsEmpty);
            Debug.Assert((object)containingAssembly != null);

            _dynamicTransformFlags = dynamicTransformFlags;
            _containingAssembly = containingAssembly;
            _haveCustomModifierFlags = haveCustomModifierFlags;
            _checkLength = checkLength;
            _index = 0;
        }
开发者ID:daking2014,项目名称:roslyn,代码行数:11,代码来源:DynamicTypeDecoder.cs


示例14: NoPiaMissingCanonicalTypeSymbol

 public NoPiaMissingCanonicalTypeSymbol(
     AssemblySymbol embeddingAssembly,
     string fullTypeName,
     string guid,
     string scope,
     string identifier)
 {
     this.embeddingAssembly = embeddingAssembly;
     this.fullTypeName = fullTypeName;
     this.guid = guid;
     this.scope = scope;
     this.identifier = identifier;
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:13,代码来源:NoPiaMissingCanonicalTypeSymbol.cs


示例15: NoPiaMissingCanonicalTypeSymbol

 public NoPiaMissingCanonicalTypeSymbol(
     AssemblySymbol embeddingAssembly,
     string fullTypeName,
     string guid,
     string scope,
     string identifier)
 {
     _embeddingAssembly = embeddingAssembly;
     _fullTypeName = fullTypeName;
     _guid = guid;
     _scope = scope;
     _identifier = identifier;
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:13,代码来源:NoPiaMissingCanonicalTypeSymbol.cs


示例16: Create

        internal static LocalSymbol Create(
            TypeNameDecoder<PEModuleSymbol, TypeSymbol> typeNameDecoder,
            MethodSymbol containingMethod,
            AssemblySymbol sourceAssembly,
            Alias alias)
        {
            var typeName = alias.Type;
            Debug.Assert(typeName.Length > 0);

            var type = typeNameDecoder.GetTypeSymbolForSerializedType(typeName);
            Debug.Assert((object)type != null);

            var dynamicFlagsInfo = alias.CustomTypeInfo.ToDynamicFlagsCustomTypeInfo();
            if (dynamicFlagsInfo.Any())
            {
                var flagsBuilder = ArrayBuilder<bool>.GetInstance();
                dynamicFlagsInfo.CopyTo(flagsBuilder);
                var dynamicType = DynamicTypeDecoder.TransformTypeWithoutCustomModifierFlags(
                    type,
                    sourceAssembly,
                    RefKind.None,
                    flagsBuilder.ToImmutableAndFree(),
                    checkLength: false);
                Debug.Assert(dynamicType != null);
                Debug.Assert(dynamicType != type);
                type = dynamicType;
            }

            var name = alias.FullName;
            var displayName = alias.Name;
            switch (alias.Kind)
            {
                case DkmClrAliasKind.Exception:
                    return new ExceptionLocalSymbol(containingMethod, name, displayName, type, ExpressionCompilerConstants.GetExceptionMethodName);
                case DkmClrAliasKind.StowedException:
                    return new ExceptionLocalSymbol(containingMethod, name, displayName, type, ExpressionCompilerConstants.GetStowedExceptionMethodName);
                case DkmClrAliasKind.ReturnValue:
                    {
                        int index;
                        PseudoVariableUtilities.TryParseReturnValueIndex(name, out index);
                        Debug.Assert(index >= 0);
                        return new ReturnValueLocalSymbol(containingMethod, name, displayName, type, index);
                    }
                case DkmClrAliasKind.ObjectId:
                    return new ObjectIdLocalSymbol(containingMethod, type, name, displayName, isWritable: false);
                case DkmClrAliasKind.Variable:
                    return new ObjectIdLocalSymbol(containingMethod, type, name, displayName, isWritable: true);
                default:
                    throw ExceptionUtilities.UnexpectedValue(alias.Kind);
            }
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:51,代码来源:PlaceholderLocalSymbol.cs


示例17: TestBaseTypeResolutionHelper1

        private void TestBaseTypeResolutionHelper1(AssemblySymbol assembly)
        {
            var module0 = assembly.Modules[0];

            var sys = module0.GlobalNamespace.GetMembers("System");
            var collections = ((NamespaceSymbol)sys[0]).GetMembers("Collections");
            var generic = ((NamespaceSymbol)collections[0]).GetMembers("Generic");
            var dictionary = ((NamespaceSymbol)generic[0]).GetMembers("Dictionary");
            var @base = ((NamedTypeSymbol)dictionary[0]).BaseType;

            AssertBaseType(@base, "System.Object");
            Assert.Null(@base.BaseType);

            var concurrent = ((NamespaceSymbol)collections[0]).GetMembers("Concurrent");

            var orderablePartitioners = ((NamespaceSymbol)concurrent[0]).GetMembers("OrderablePartitioner");
            NamedTypeSymbol orderablePartitioner = null;

            foreach (var p in orderablePartitioners)
            {
                var t = p as NamedTypeSymbol;

                if (t != null && t.Arity == 1)
                {
                    orderablePartitioner = t;
                    break;
                }
            }

            @base = orderablePartitioner.BaseType;

            AssertBaseType(@base, "System.Collections.Concurrent.Partitioner<TSource>");
            Assert.Same(((NamedTypeSymbol)@base).TypeArguments[0], orderablePartitioner.TypeParameters[0]);

            var partitioners = ((NamespaceSymbol)concurrent[0]).GetMembers("Partitioner");
            NamedTypeSymbol partitioner = null;

            foreach (var p in partitioners)
            {
                var t = p as NamedTypeSymbol;

                if (t != null && t.Arity == 0)
                {
                    partitioner = t;
                    break;
                }
            }

            Assert.NotNull(partitioner);
        }
开发者ID:riversky,项目名称:roslyn,代码行数:50,代码来源:BaseTypeResolution.cs


示例18: Create

        internal static LocalSymbol Create(
            TypeNameDecoder<PEModuleSymbol, TypeSymbol> typeNameDecoder,
            MethodSymbol containingMethod,
            AssemblySymbol sourceAssembly,
            Alias alias)
        {
            var typeName = alias.Type;
            Debug.Assert(typeName.Length > 0);

            var type = typeNameDecoder.GetTypeSymbolForSerializedType(typeName);
            Debug.Assert((object)type != null);

            ReadOnlyCollection<byte> dynamicFlags;
            ReadOnlyCollection<string> tupleElementNames;
            CustomTypeInfo.Decode(alias.CustomTypeInfoId, alias.CustomTypeInfo, out dynamicFlags, out tupleElementNames);

            if (dynamicFlags != null)
            {
                type = DecodeDynamicTypes(type, sourceAssembly, dynamicFlags);
            }

            if (tupleElementNames != null)
            {
                type = TupleTypeDecoder.DecodeTupleTypesIfApplicable(type, sourceAssembly, tupleElementNames.AsImmutable());
            }

            var name = alias.FullName;
            var displayName = alias.Name;
            switch (alias.Kind)
            {
                case DkmClrAliasKind.Exception:
                    return new ExceptionLocalSymbol(containingMethod, name, displayName, type, ExpressionCompilerConstants.GetExceptionMethodName);
                case DkmClrAliasKind.StowedException:
                    return new ExceptionLocalSymbol(containingMethod, name, displayName, type, ExpressionCompilerConstants.GetStowedExceptionMethodName);
                case DkmClrAliasKind.ReturnValue:
                    {
                        int index;
                        PseudoVariableUtilities.TryParseReturnValueIndex(name, out index);
                        Debug.Assert(index >= 0);
                        return new ReturnValueLocalSymbol(containingMethod, name, displayName, type, index);
                    }
                case DkmClrAliasKind.ObjectId:
                    return new ObjectIdLocalSymbol(containingMethod, type, name, displayName, isWritable: false);
                case DkmClrAliasKind.Variable:
                    return new ObjectIdLocalSymbol(containingMethod, type, name, displayName, isWritable: true);
                default:
                    throw ExceptionUtilities.UnexpectedValue(alias.Kind);
            }
        }
开发者ID:orthoxerox,项目名称:roslyn,代码行数:49,代码来源:PlaceholderLocalSymbol.cs


示例19: TestTypeForwarderHelper

        private void TestTypeForwarderHelper(AssemblySymbol[] assemblies)
        {
            var module1 = (PEModuleSymbol)assemblies[0].Modules[0];
            var module2 = (PEModuleSymbol)assemblies[1].Modules[0];

            var assembly2 = (MetadataOrSourceAssemblySymbol)assemblies[1];
            var assembly3 = (MetadataOrSourceAssemblySymbol)assemblies[2];

            var derived1 = module1.GlobalNamespace.GetTypeMembers("Derived").Single();
            var base1 = derived1.BaseType;
            BaseTypeResolution.AssertBaseType(base1, "Base");

            var derived4 = module1.GlobalNamespace.GetTypeMembers("GenericDerived").Single();
            var base4 = derived4.BaseType;
            BaseTypeResolution.AssertBaseType(base4, "GenericBase<K>");

            var derived6 = module1.GlobalNamespace.GetTypeMembers("GenericDerived1").Single();
            var base6 = derived6.BaseType;
            BaseTypeResolution.AssertBaseType(base6, "GenericBase<K>.NestedGenericBase<L>");

            Assert.Equal(assembly3, base1.ContainingAssembly);
            Assert.Equal(assembly3, base4.ContainingAssembly);
            Assert.Equal(assembly3, base6.ContainingAssembly);

            Assert.Equal(base1, module1.TypeRefHandleToTypeMap[(TypeReferenceHandle)module1.Module.GetBaseTypeOfTypeOrThrow(((PENamedTypeSymbol)derived1).Handle)]);
            Assert.True(module1.TypeRefHandleToTypeMap.Values.Contains((TypeSymbol)base4.OriginalDefinition));
            Assert.True(module1.TypeRefHandleToTypeMap.Values.Contains((TypeSymbol)base6.OriginalDefinition));

            Assert.Equal(base1, assembly2.CachedTypeByEmittedName(base1.ToTestDisplayString()));
            Assert.Equal(base4.OriginalDefinition, assembly2.CachedTypeByEmittedName("GenericBase`1"));
            Assert.Equal(2, assembly2.EmittedNameToTypeMapCount);

            Assert.Equal(base1, assembly3.CachedTypeByEmittedName(base1.ToTestDisplayString()));
            Assert.Equal(base4.OriginalDefinition, assembly3.CachedTypeByEmittedName("GenericBase`1"));
            Assert.Equal(2, assembly3.EmittedNameToTypeMapCount);

            var derived2 = module2.GlobalNamespace.GetTypeMembers("Derived").Single();
            var base2 = derived2.BaseType;
            BaseTypeResolution.AssertBaseType(base2, "Base");
            Assert.Same(base2, base1);

            var derived3 = module2.GlobalNamespace.GetTypeMembers("GenericDerived").Single();
            var base3 = derived3.BaseType;
            BaseTypeResolution.AssertBaseType(base3, "GenericBase<S>");

            var derived5 = module2.GlobalNamespace.GetTypeMembers("GenericDerived1").Single();
            var base5 = derived5.BaseType;
            BaseTypeResolution.AssertBaseType(base5, "GenericBase<S1>.NestedGenericBase<S2>");
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:49,代码来源:TypeForwarders.cs


示例20: TransformTypeWithoutCustomModifierFlags

 internal static TypeSymbol TransformTypeWithoutCustomModifierFlags(
     TypeSymbol type,
     AssemblySymbol containingAssembly,
     RefKind targetSymbolRefKind,
     ImmutableArray<bool> dynamicTransformFlags,
     bool checkLength = true)
 {
     return TransformTypeInternal(
         type,
         containingAssembly,
         0,
         targetSymbolRefKind,
         dynamicTransformFlags,
         haveCustomModifierFlags: false,
         checkLength: checkLength);
 }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:16,代码来源:DynamicTypeDecoder.cs



注:本文中的AssemblySymbol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AssertionConditionType类代码示例发布时间:2022-05-24
下一篇:
C# AssemblyResolver类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap