• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 22018529184

14 Feb 2026 01:49PM UTC coverage: 34.4%. Remained the same
22018529184

push

github

SamboyCoding
Fixed broken parenthesis

1819 of 6636 branches covered (27.41%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 2 files covered. (0.0%)

4212 of 10896 relevant lines covered (38.66%)

211063.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

34.38
/Cpp2IL.Core/Model/CustomAttributes/CustomAttributeTypeParameter.cs
1
using System.IO;
2
using Cpp2IL.Core.Extensions;
3
using Cpp2IL.Core.Model.Contexts;
4
using Cpp2IL.Core.Utils;
5
using LibCpp2IL;
6
using LibCpp2IL.BinaryStructures;
7

8
namespace Cpp2IL.Core.Model.CustomAttributes;
9

10
/// <summary>
11
/// Represents a <see cref="BaseCustomAttributeTypeParameter"/> for a <see cref="Il2CppType"/>.
12
/// </summary>
13
public class CustomAttributeTypeParameter : BaseCustomAttributeTypeParameter
14
{
15
    private Il2CppType? _type;
16
    private TypeAnalysisContext? _typeContext;
17

18
    public override TypeAnalysisContext? TypeContext
19
    {
20
        get
21
        {
22
            return _typeContext ??= Owner.Constructor.CustomAttributeAssembly.ResolveIl2CppType(_type);
1✔
23
        }
24
    }
25

26
    public CustomAttributeTypeParameter(Il2CppType? type, AnalyzedCustomAttribute owner, CustomAttributeParameterKind kind, int index) : base(owner, kind, index)
×
27
    {
28
        _type = type;
×
29
    }
×
30

31
    public CustomAttributeTypeParameter(TypeAnalysisContext? type, AnalyzedCustomAttribute owner, CustomAttributeParameterKind kind, int index) : base(owner, kind, index)
×
32
    {
33
        _typeContext = type;
×
34
    }
×
35

36
    public CustomAttributeTypeParameter(AnalyzedCustomAttribute owner, CustomAttributeParameterKind kind, int index) : base(owner, kind, index)
2✔
37
    {
38
    }
2✔
39

40
    public override void ReadFromV29Blob(BinaryReader reader, ApplicationAnalysisContext context)
41
    {
42
        var typeIndex = reader.BaseStream.ReadUnityCompressedInt();
2✔
43
        if (typeIndex == -1)
2!
44
            _type = null;
×
45
        else
46
        {
47
            _type = context.Binary.GetType(typeIndex);
2✔
48
        }
49
        _typeContext = null;
2✔
50
    }
2✔
51

52
    public override string ToString()
53
    {
54
        if (TypeContext == null)
×
55
            return "(Type) null";
×
56

57
        if (TypeContext.Type is var typeEnum && typeEnum.IsIl2CppPrimitive())
×
NEW
58
            return $"typeof({LibCpp2ILUtils.GetTypeName(TypeContext.Type)})";
×
59

60
        if (TypeContext is ReferencedTypeAnalysisContext)
×
61
        {
62
            return $"typeof({TypeContext.GetCSharpSourceString()})";
×
63
        }
64

65
        //Basic class/struct
66
        return $"typeof({TypeContext.Name})";
×
67
    }
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc