Skip to content

Commit 695bba2

Browse files
committed
simple test case for generic method inference (it works as expected)
1 parent 7b23cc7 commit 695bba2

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace UnityScript.Tests.CSharp
2+
{
3+
public static class Generics
4+
{
5+
public static T Identity<T>(T o)
6+
{
7+
return o;
8+
}
9+
}
10+
}

src/UnityScript.Tests/GenericsTestFixture.Generated.boo

+4
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ class GenericsTestFixture(AbstractIntegrationTestFixture):
1010
[Test]
1111
def generic_list_instantiation_1():
1212
RunTestCase("tests/generics/generic-list-instantiation-1.js")
13+
14+
[Test]
15+
def generic_method_1():
16+
RunTestCase("tests/generics/generic-method-1.js")
1317

tests/generics/generic-method-1.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
True
3+
True
4+
*/
5+
var s = "42";
6+
print(s == UnityScript.Tests.CSharp.Generics.Identity(s));
7+
8+
var i = 42;
9+
print(i == UnityScript.Tests.CSharp.Generics.Identity(i));

0 commit comments

Comments
 (0)