< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 14
Coverable lines: 14
Total lines: 44
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
DecodeSignature(...)100%110%
GetCustomAttributes()100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/TypeSystem/TypeSpecification.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Reflection.Metadata.Ecma335;
 5
 6namespace System.Reflection.Metadata
 7{
 8    public readonly struct TypeSpecification
 9    {
 10        private readonly MetadataReader _reader;
 11
 12        // Workaround: JIT doesn't generate good code for nested structures, so use RowId.
 13        private readonly int _rowId;
 14
 15        internal TypeSpecification(MetadataReader reader, TypeSpecificationHandle handle)
 016        {
 017            _reader = reader;
 018            _rowId = handle.RowId;
 019        }
 20
 21        private TypeSpecificationHandle Handle
 22        {
 023            get { return TypeSpecificationHandle.FromRowId(_rowId); }
 24        }
 25
 26        public BlobHandle Signature
 27        {
 028            get { return _reader.TypeSpecTable.GetSignature(Handle); }
 29        }
 30
 31        public TType DecodeSignature<TType, TGenericContext>(ISignatureTypeProvider<TType, TGenericContext> provider, TG
 032        {
 033            var decoder = new SignatureDecoder<TType, TGenericContext>(provider, _reader, genericContext);
 034            var blobReader = _reader.GetBlobReader(Signature);
 035            return decoder.DecodeType(ref blobReader);
 036        }
 37
 38        public CustomAttributeHandleCollection GetCustomAttributes()
 039        {
 040            return new CustomAttributeHandleCollection(_reader, Handle);
 041        }
 42    }
 43}
 44