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

SamboyCoding / Cpp2IL / 20487925661

24 Dec 2025 02:11PM UTC coverage: 34.275% (-0.04%) from 34.31%
20487925661

push

github

SamboyCoding
Other properties too

This also makes ParameterAnalysisContext::ParameterType not virtual

1791 of 6588 branches covered (27.19%)

Branch coverage included in aggregate %.

10 of 20 new or added lines in 7 files covered. (50.0%)

129 existing lines in 7 files now uncovered.

4191 of 10865 relevant lines covered (38.57%)

180313.71 hits per line

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

75.68
/Cpp2IL.Core/Model/Contexts/GenericParameterTypeAnalysisContext.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Reflection;
5
using Cpp2IL.Core.Utils;
6
using LibCpp2IL.BinaryStructures;
7
using LibCpp2IL.Metadata;
8

9
namespace Cpp2IL.Core.Model.Contexts;
10

11
public class GenericParameterTypeAnalysisContext : ReferencedTypeAnalysisContext
12
{
13
    private readonly Il2CppGenericParameter? definition;
14

15
    public sealed override string DefaultName { get; }
2,260✔
16

17
    public sealed override string DefaultNamespace => "";
×
18

19
    public int Index { get; }
212,244✔
20

21
    public override Il2CppTypeEnum Type { get; }
212,244✔
22

23
    public new GenericParameterAttributes DefaultAttributes { get; }
2,260✔
24
    public new GenericParameterAttributes? OverrideAttributes { get; set; }
2,260✔
25
    public new GenericParameterAttributes Attributes
26
    {
27
        get => OverrideAttributes ?? DefaultAttributes;
2,260!
UNCOV
28
        set => OverrideAttributes = value;
×
29
    }
30

31
    private List<TypeAnalysisContext>? _constraintTypes;
32
    public List<TypeAnalysisContext> ConstraintTypes
33
    {
34
        get
35
        {
36
            _constraintTypes ??= definition?.ConstraintTypes.Select(t => DeclaringAssembly.ResolveIl2CppType(t)).ToList() ?? [];
2,635!
37
            return _constraintTypes;
2,260✔
38
        }
39
    }
40

UNCOV
41
    public HasGenericParameters Owner { get; }
×
42

43
    /// <summary>
44
    /// This should only be used by the initializers for <see cref="TypeAnalysisContext.GenericParameters"/> and <see cref="MethodAnalysisContext.GenericParameters"/>.
45
    /// It ensures that generic parameters are only held by their owners.
46
    /// </summary>
47
    internal GenericParameterTypeAnalysisContext(Il2CppGenericParameter genericParameter, HasGenericParameters owner)
48
        : this(genericParameter.Name ?? "T", genericParameter.genericParameterIndexInOwner, genericParameter.Type, genericParameter.Attributes, owner)
10,915!
49
    {
50
        definition = genericParameter;
10,915✔
51
    }
10,915✔
52

53
    public GenericParameterTypeAnalysisContext(string name, int index, Il2CppTypeEnum type, GenericParameterAttributes attributes, HasGenericParameters owner) : base(owner.CustomAttributeAssembly)
10,915✔
54
    {
55
        if (type is not Il2CppTypeEnum.IL2CPP_TYPE_VAR and not Il2CppTypeEnum.IL2CPP_TYPE_MVAR)
10,915!
UNCOV
56
            throw new ArgumentException($"Generic parameter type is not a generic parameter, but {type}", nameof(type));
×
57

58
        DefaultName = name;
10,915✔
59
        Index = index;
10,915✔
60
        Type = type;
10,915✔
61
        DefaultAttributes = attributes;
10,915✔
62
        Owner = owner;
10,915✔
63
    }
10,915✔
64
}
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