New test that tests template inference through instantiated templates, implemented it in kalypso, 51 tests passing
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
true
|
||||
true
|
||||
19
tests/test_templatedObjectTemplatedFunctionInference.krak
Normal file
19
tests/test_templatedObjectTemplatedFunctionInference.krak
Normal file
@@ -0,0 +1,19 @@
|
||||
import simple_print:*
|
||||
|
||||
obj Object<T> {
|
||||
var data: T
|
||||
}
|
||||
|
||||
fun get<T>(a: Object<T>): T {
|
||||
var temp = a.data;
|
||||
println(temp)
|
||||
return temp
|
||||
}
|
||||
|
||||
fun main(): int {
|
||||
var b: Object<bool>
|
||||
b.data = true
|
||||
println(get(b))
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user