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

SamboyCoding / Cpp2IL / 20488056168

24 Dec 2025 02:19PM UTC coverage: 34.361% (+0.05%) from 34.31%
20488056168

Pull #499

github

web-flow
Merge 482cdd13f into 3a72c253a
Pull Request #499: Add ResolveContextForMethod overload taking Cpp2IlMethodRef as a parameter

1811 of 6624 branches covered (27.34%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 1 file covered. (0.0%)

187 existing lines in 10 files now uncovered.

4208 of 10893 relevant lines covered (38.63%)

201355.63 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; }
250,156✔
20

21
    public override Il2CppTypeEnum Type { get; }
250,156✔
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)
12,471!
49
    {
50
        definition = genericParameter;
12,471✔
51
    }
12,471✔
52

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

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