A kinda ugly/hacky addition, but overloading () as operator() works now!
This commit is contained in:
2
tests/test_functionOperator.expected_results
Normal file
2
tests/test_functionOperator.expected_results
Normal file
@@ -0,0 +1,2 @@
|
||||
7
|
||||
hi
|
||||
17
tests/test_functionOperator.krak
Normal file
17
tests/test_functionOperator.krak
Normal file
@@ -0,0 +1,17 @@
|
||||
import io:*
|
||||
|
||||
typedef FuncObj {
|
||||
fun operator()(a:int, b:char*): void {
|
||||
println(a)
|
||||
println(b)
|
||||
}
|
||||
}
|
||||
|
||||
fun main():int {
|
||||
var obj:FuncObj
|
||||
obj(7, "hi")
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user