MichalStrehovsky / iltrim

MIT License
9 stars 1 forks source link

Handle generic types inheriting from generic types #78

Closed agocke closed 2 years ago

agocke commented 2 years ago

The static dependency scanning of generic types needs to handle substituted base types. The following example should reproduce the problem:


using Mono.Linker.Tests.Cases.Expectations.Assertions;

namespace Mono.Linker.Tests.Cases.Basic
{
    [Kept]
    class GenericType
    {
        [Kept]
        public static void Main()
        {
            var c = new C();
        }
    }

    class A<T>
    {

    }
    class B<T> : A<string>
    {

    }
    class C : B<int>
    {
    }
}
MichalStrehovsky commented 2 years ago

Fixed