Flee icon indicating copy to clipboard operation
Flee copied to clipboard

Allow evaluating void return methods

Open huantianad opened this issue 3 years ago • 2 comments

Allow for the evaluation of methods which return void purely for the side effect, possibly under an option.

Not sure how actively maintained this project is any more, I do see @hunkydoryrepair has a more active repo with some bug fixes, but not sure if this one is active anymore.

huantianad avatar Dec 11 '21 01:12 huantianad

I'm not sure your suggestion makes sense. How would you use a void method in an expression? Only the code necessary for evaluation is run. Can you give an example? You can always create you own methods that have a side effect and then return a value (ie. return this).

hunkydoryrepair avatar Dec 12 '21 22:12 hunkydoryrepair

Yeah my workaround has just been to return null. My use case is generally evaluating a method directly, for example, I could want to evaluate an expression like Console.WriteLine(1 + 1), which I'm only calling to evaluate the insides of the function and print it into the console (probably not something I would do).

huantianad avatar Dec 13 '21 01:12 huantianad