wollok icon indicating copy to clipboard operation
wollok copied to clipboard

Add scala-ish ??? value to have as stub expression

Open mmatos opened this issue 7 years ago • 2 comments

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.

mmatos avatar Aug 18 '17 20:08 mmatos

I think there could be two quickfixes possibilities for returning expressions

fdodino avatar Aug 30 '17 21:08 fdodino

Like

npasserini avatar Sep 05 '17 00:09 npasserini