Skip to content

Commit 4dcafe1

Browse files
committed
Fix issue sq#204 and add test.
1 parent 240ed75 commit 4dcafe1

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

Libraries/JSIL.Core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5753,7 +5753,7 @@ JSIL.InterfaceBuilder.prototype.Method = function (_descriptor, methodName, sign
57535753

57545754
JSIL.SetValueProperty(descriptor.Target, mangledName, methodObject);
57555755

5756-
if (!descriptor.Target[methodName])
5756+
if (!descriptor.Target[descriptor.EscapedName])
57575757
JSIL.SetValueProperty(descriptor.Target, descriptor.EscapedName, methodObject);
57585758
} else {
57595759
var fullName = this.namespace + "." + methodName;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// #issue #204
2+
3+
using System;
4+
5+
interface ITypePrinter {
6+
void Print (Type type);
7+
8+
void Print<T> ();
9+
}
10+
11+
class TypePrinter : ITypePrinter {
12+
public void Print (Type type) {
13+
Console.WriteLine(type);
14+
}
15+
16+
public void Print<T> () {
17+
Print(typeof(T));
18+
}
19+
}
20+
21+
class Program {
22+
public static void Main () {
23+
// This works
24+
TypePrinter printer = new TypePrinter();
25+
printer.Print<object>();
26+
27+
// This doesn't work
28+
((ITypePrinter)printer).Print<object>();
29+
}
30+
}

Tests/Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
<None Include="SimpleTestCases\StructHoistingInComplexLoop.cs" />
180180
<None Include="SimpleTestCases\RefDouble.cs" />
181181
<None Include="SimpleTestCases\Issue205.cs" />
182+
<None Include="InterfaceTestCases\OverloadedGenericMethodInsideNonGenericInterface.cs" />
182183
<Compile Include="TypeInformationTests.cs" />
183184
<None Include="TestCases\LongArithmetic.cs" />
184185
<None Include="InterfaceTestCases\NestedInterfaces.cs" />

0 commit comments

Comments
 (0)