sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Assembly.GetType is not working for generics. #1035

Open tosandeepgarg opened 7 years ago

tosandeepgarg commented 7 years ago

Following code doesn't work.

typeof(object).Assembly.GetType(
                "System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[System.Object, mscorlib]]");

Here is test case:

using System;

public static class Program
{
    public static void Main(string[] args)
    {
        var typeInt32 = typeof(object).Assembly.GetType("System.Int32");
        var typeDictionary =
            typeof (object).Assembly.GetType(
                "System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib],[System.Object, mscorlib]]");
        Console.WriteLine(
            "{0} {1}", typeInt32.Name, typeDictionary.Name
            );

    }
}