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

Corrected generic type FullName property #1040

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions JSIL.Libraries/Sources/JSIL.Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ JSIL.$GetSpecialType = function (name) {
for (var i = 0, l = ga.length; i < l; i++) {
var type = ga[i];
result += "[" + type.get_AssemblyQualifiedName() + "]";
if(i<l-1)
{
result+=","
}
}

result += "]";
Expand Down
20 changes: 20 additions & 0 deletions Tests/SimpleTestCases/CreateTypeFromName_Issue1039.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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();
var 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 { }
1 change: 1 addition & 0 deletions Tests/SimpleTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<None Include="SimpleTestCases\NullableUnary_Issue997.cs" />
<None Include="SimpleTestCasesForTranslatedBcl\Issue1008_MethodReturnType.cs" />
<None Include="SimpleTestCases\GetTypeFromAssembly_Issue1035.cs" />
<None Include="SimpleTestCases\CreateTypeFromName.cs" />
<Compile Include="SimpleTests.cs" />
<None Include="SimpleTestCases\BaseAutoProperties.cs" />
<None Include="SimpleTestCases\OverloadedVirtualMethods.cs" />
Expand Down