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

SamboyCoding / Cpp2IL / 26005967564

17 May 2026 11:34PM UTC coverage: 35.273% (-0.06%) from 35.33%
26005967564

Pull #552

github

web-flow
Merge d03ec7dd9 into 6af99f218
Pull Request #552: Fix name overrides for constructed types

1974 of 6975 branches covered (28.3%)

Branch coverage included in aggregate %.

2 of 53 new or added lines in 12 files covered. (3.77%)

1 existing line in 1 file now uncovered.

4495 of 11365 relevant lines covered (39.55%)

252024.2 hits per line

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

71.79
/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 sealed override string? OverrideNamespace
20
    {
NEW
21
        get => null;
×
22
        set
23
        {
NEW
24
        }
×
25
    }
26

27
    public int Index { get; }
345,351✔
28

29
    public sealed override Il2CppTypeEnum Type { get; }
345,351✔
30

31
    public new GenericParameterAttributes DefaultAttributes { get; }
2,260✔
32
    public new GenericParameterAttributes? OverrideAttributes { get; set; }
2,260✔
33
    public new GenericParameterAttributes Attributes
34
    {
35
        get => OverrideAttributes ?? DefaultAttributes;
2,260!
36
        set => OverrideAttributes = value;
×
37
    }
38

39
    private List<TypeAnalysisContext>? _constraintTypes;
40
    public List<TypeAnalysisContext> ConstraintTypes
41
    {
42
        get
43
        {
44
            _constraintTypes ??= definition?.ConstraintTypes.Select(t => DeclaringAssembly.ResolveIl2CppType(t)).ToList() ?? [];
2,635!
45
            return _constraintTypes;
2,260✔
46
        }
47
    }
48

49
    public HasGenericParameters Owner { get; }
×
50

51
    /// <summary>
52
    /// This should only be used by the initializers for <see cref="TypeAnalysisContext.GenericParameters"/> and <see cref="MethodAnalysisContext.GenericParameters"/>.
53
    /// It ensures that generic parameters are only held by their owners.
54
    /// </summary>
55
    internal GenericParameterTypeAnalysisContext(Il2CppGenericParameter genericParameter, HasGenericParameters owner)
56
        : this(genericParameter.Name ?? "T", genericParameter.genericParameterIndexInOwner, genericParameter.Type, genericParameter.Attributes, owner)
15,381!
57
    {
58
        definition = genericParameter;
15,381✔
59
    }
15,381✔
60

61
    public GenericParameterTypeAnalysisContext(string name, int index, Il2CppTypeEnum type, GenericParameterAttributes attributes, HasGenericParameters owner) : base(owner.CustomAttributeAssembly)
15,381✔
62
    {
63
        if (type is not Il2CppTypeEnum.IL2CPP_TYPE_VAR and not Il2CppTypeEnum.IL2CPP_TYPE_MVAR)
15,381!
64
            throw new ArgumentException($"Generic parameter type is not a generic parameter, but {type}", nameof(type));
×
65

66
        DefaultName = name;
15,381✔
67
        Index = index;
15,381✔
68
        Type = type;
15,381✔
69
        DefaultAttributes = attributes;
15,381✔
70
        Owner = owner;
15,381✔
71
    }
15,381✔
72
}
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