dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

wasm: support Generic Virtual Method Calls & Shared Generics (was: some linq methods fail to compile) #7248

Closed yowl closed 4 years ago

yowl commented 5 years ago

When attempting to build an Uno Platform project, it fails on a method

{[System.Linq]System.Linq.Enumerable+Iterator`1<Windows.UI.Xaml.Documents.Inline>.Select<string>(Func``2<Inline,string>)}

in the ctor for WebAssemblyVTableSlotNode on the assert

Debug.Assert(!targetMethod.HasInstantiation);

Not done any more investigation yet.

yowl commented 4 years ago

unblocked myself, some stupid changes I'd made to the dependencies for the unboxing stub for some reason.

yowl commented 4 years ago

Hopefully an easy question. This code:

                GenStruct<T> g = new GenStruct<T>(value);
                Func<string> f = g.MakeGenString<T>;

Where T is a class defined via the enclosing method:

        private static void RunValueTypeShared<T>(T value)

And GenStruct is a struct with that method:

        struct GenStruct<T>
        {
            public readonly T X;

            public GenStruct(T x)
            {
                X = x;
            }

            public string MakeGenString<U>()
            {

When the delegate is initialised, would you expect the function pointer (or fat pointer) to be the unboxing thunk for MakeString, or the non-unboxing method directly?

yowl commented 4 years ago

No need to answer that, have moved on a bit.