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

SamboyCoding / Cpp2IL / 30163492535

25 Jul 2026 03:21PM UTC coverage: 37.57% (-0.1%) from 37.69%
30163492535

push

github

SamboyCoding
Core+Lib: Stop using Il2CppTypeReflectionData in most places, it's not a good data type.

Also fixes silent coercion of SZArray types to Array[1] in various places in analysis

2883 of 8618 branches covered (33.45%)

Branch coverage included in aggregate %.

10 of 23 new or added lines in 10 files covered. (43.48%)

1 existing line in 1 file now uncovered.

5284 of 13120 relevant lines covered (40.27%)

168495.67 hits per line

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

3.03
/LibCpp2IL/Reflection/Il2CppTypeReflectionData.cs
1
using System.Text;
2
using LibCpp2IL.Metadata;
3

4
#pragma warning disable 8618
5
namespace LibCpp2IL.Reflection;
6

7
/// <summary>
8
/// A wrapper around Il2CppTypeDefinition to allow expression of complex types such as Generics. Can represent one of three things:
9
/// <ul>
10
/// <li>If both <see cref="isType"/> and <see cref="isGenericType"/> are false, this represents a generic parameter (such as the T in List&lt;T>)</li>
11
/// <li>If <see cref="isType"/> is true and <see cref="isGenericType"/> is false, this represents a standard Il2CppTypeDefinition - check <see cref="baseType"/> to see what</li>
12
/// <li>If both <see cref="isType"/> and <see cref="isGenericType"/> are true, this is a complex generic type, of basic type <see cref="baseType"/> - this is where the List part would be - and with params stored in <see cref="genericParams"/> - these may be any of these three cases again.</li>
13
/// </ul>
14
/// <br/>
15
/// Calling <see cref="ToString"/> on this object will return the canonical representation of this object, with generic params such as System.Collections.Generic.List`1&lt;T> or with concrete types, like in the case of a String's interfaces, <code>System.Collections.Generic.IEnumerable`1&lt;System.Char&gt;</code>
16
/// </summary>
17
public class Il2CppTypeReflectionData(LibCpp2IlContext owningContext)
12,987✔
18
{
19
    public Il2CppTypeDefinition? baseType;
20
    public Il2CppTypeReflectionData[] genericParams;
21
    public bool isType;
22
    public bool isGenericType;
23
    public bool isArray;
24
    public Il2CppTypeReflectionData? arrayType;
25
    public byte arrayRank;
26
    public string variableGenericParamName;
27
    public Il2CppVariableWidthIndex<Il2CppGenericParameter> variableGenericParamIndex;
28
    public bool isPointer;
29
#pragma warning restore 8618
30

UNCOV
31
    public Il2CppGenericParameter? GenericParameter => isArray || isType ? null : owningContext.Metadata.GetGenericParameterFromIndex(variableGenericParamIndex);
×
32

33
    private string GetPtrSuffix()
34
    {
35
        return isPointer ? "*" : "";
×
36
    }
37

38
    public override string ToString()
39
    {
40
        if (isArray)
×
41
            return arrayType + "[]".Repeat(arrayRank) + GetPtrSuffix();
×
42

43
        if (!isType)
×
44
            return variableGenericParamName + GetPtrSuffix();
×
45

46
        if (!isGenericType)
×
47
            return baseType!.FullName! + GetPtrSuffix();
×
48

49
        var builder = new StringBuilder(baseType!.FullName + "<");
×
50
        foreach (var genericParam in genericParams)
×
51
        {
52
            builder.Append(genericParam).Append(", ");
×
53
        }
54

55
        builder.Remove(builder.Length - 2, 2);
×
56
        builder.Append(">");
×
57
        return builder + GetPtrSuffix();
×
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc