Implicit 'this' return for void methods (original) (raw)

Marek Kozieł develop4lasu at gmail.com
Mon Mar 31 22:25:25 UTC 2014


2014-03-31 22:44 GMT+02:00 Paul Benedict <pbenedict at apache.org>:

What about opting in? By that, I mean that these void methods must have a specific TYPEUSE annotation on them at compile time to allow chaining.

This idea would require a JLS update to allow type annotations on void return values -- perhaps exclusive to this annotation.

I was thinking about : void method() to be equivalent, or maybe noted as : this method()

And void function to be replaced with specific class like(I use this here and there when direct use of void is not possible and this work pretty well):

java.lang.Void methid(); or maybe noted as: null method();

So hopefully this would fit language peaty well. Any way it's to early for me to comprehend influence of such big change. I do not like such know-how solutions.

-- Pozdrawiam Marek Kozieł ( Lasu )

http://na-chlodno.blogspot.com/ http://lasu2string.blogspot.com/



More information about the core-libs-dev mailing list