diff --git a/tests/test_functionTemplateInference.expected_results b/tests/test_functionTemplateInference.expected_results index 45a4fb7..236483f 100644 --- a/tests/test_functionTemplateInference.expected_results +++ b/tests/test_functionTemplateInference.expected_results @@ -1 +1,3 @@ 8 +9 +10 diff --git a/tests/test_functionTemplateInference.krak b/tests/test_functionTemplateInference.krak index 55e03d8..a7ad5be 100644 --- a/tests/test_functionTemplateInference.krak +++ b/tests/test_functionTemplateInference.krak @@ -1,5 +1,22 @@ import io:* +fun funcID(genFun: fun():T):T { + return genFun() +} + +fun retInt():int { + return 9 +} + +fun doThePrint(func: fun(T):void):void { + func(10) +} + +fun printInt(it:int):void { + println(it) +} + + fun ptrFn(ptr: T*):void { println(*ptr) } @@ -7,6 +24,8 @@ fun ptrFn(ptr: T*):void { fun main():int { var a = 8 ptrFn(&a) + println(funcID(retInt)) + doThePrint(printInt) return 0 }