Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Type.FullName is not returning correct name for generic dictionary #1039

Open
tosandeepgarg opened this issue Mar 1, 2017 · 0 comments · May be fixed by #1040
Open

Type.FullName is not returning correct name for generic dictionary #1039

tosandeepgarg opened this issue Mar 1, 2017 · 0 comments · May be fixed by #1040
Labels

Comments

@tosandeepgarg
Copy link

tosandeepgarg commented Mar 1, 2017

Type.FullName returns generic arguments without separator.

In next test case instead of return type name System.Collections.Generic.Dictionary2[[A, CreateTypeFromName.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null],[B, CreateTypeFromName.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] it returns

System.Collections.Generic.Dictionary2[[A, CreateTypeFromName.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null][B, CreateTypeFromName.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]

Here is test case:

using System;
using System.Collections.Generic;

public static class Program
{
    public static void Main(string[] args)
    {
        var dictionary = new Dictionary<A,B>();
        var dictionaryType = dictionary.GetType();
        Type type = Type.GetType(dictionaryType.FullName);
        if (type != null)
            Activator.CreateInstance(type);
        Console.WriteLine(
            "{0},{1}", dictionaryType.Name,dictionaryType.FullName
            );

    }
}

public class A { }
public class B { }
@kg kg added the Bug label Mar 1, 2017
tosandeepgarg pushed a commit to SabaSoftware/JSIL that referenced this issue Mar 1, 2017
tosandeepgarg added a commit to SabaSoftware/JSIL that referenced this issue Mar 1, 2017
@tosandeepgarg tosandeepgarg linked a pull request Mar 1, 2017 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants