generic parameters for functions added

This commit is contained in:
Sergey Ignatov
2011-11-01 15:54:18 +04:00
parent 8f97c76c07
commit 69b9100890
4 changed files with 40 additions and 5 deletions
@@ -41,4 +41,25 @@ public class FunctionTest extends JetTestCaseBase {
"fun isTrue() : Boolean { return true }"
);
}
public void testClassGenericParam() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("T getT() {}"),
"fun getT() : T? { }"
);
}
public void testOwnGenericParam() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("<U> void putU(U u) {}"),
"fun putU<U>(u : U?) : Unit { }"
);
}
public void testOwnSeveralGenericParams() throws Exception {
Assert.assertEquals(
methodToSingleLineKotlin("<U, V, W> void putUVW(U u, V v, W w) {}"),
"fun putUVW<U, V, W>(u : U?, v : V?, w : W?) : Unit { }"
);
}
}