wollok
wollok copied to clipboard
Add scala-ish ??? value to have as stub expression
I was trying to do some quickfix oriented programming and when you create a method that is expected to return something, the method is created with an empty body and no return clause, which makes the message send that originated the quickfix to still not compile.
I thought it would be great if instead of using this template:
method x() {
//TODO: Autogenerated Code !
}
One of these would be used instead when the sender expects a return value:
method x() {
//TODO: Autogenerated Code !
return ???
}
method x() = ???
And have the ??? value compile and fail in runtime, like it happens in Scala, but also mark it as a warning so the student will not miss fixing it, even if they erase the TODO comment or manually use ??? somewhere.
I think there could be two quickfixes possibilities for returning expressions
Like