Skip to content

Commit

Permalink
Merge pull request #2 from SabaSoftware/GenericType_1039
Browse files Browse the repository at this point in the history
Generic type fix (sq#1039)
  • Loading branch information
tosandeepgarg authored Mar 1, 2017
2 parents cd542b6 + d2930b9 commit 4f380f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
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 @@ -151,6 +151,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

0 comments on commit 4f380f0

Please sign in to comment.