Files
kraken/tests/to_parse.krak

30 lines
617 B
Plaintext
Raw Normal View History

import simple_print: *
obj SimpleContainer<T> {
var data: T
fun print_data() {
var indirection: T
indirection = data
println(indirection)
}
fun with_other<U>(other: U) {
var indirection: U
indirection = other
println(data)
println(other)
}
fun return_as<U>(): U {
var indirection: T
indirection = data
return data
}
fun construct(dataIn: T) data = dataIn
}
fun main(): int {
var it: SimpleContainer<int>
it.data = 8
it.with_other("Wooo object template")
println(it.return_as<float>())
}