Hello! I don't think that `void foo() -> null` should be supported. Like in lambdas if the method returns void, only expressions which can be used as expression statement should be allowed. I don't think that special support for empty bodies is necessary as {} is short enough. Especially if your code style is not very bureaucratic and allows you to write `void foo() {}` in single line.
With best regards, Tagir Valeev. вс, 30 сент. 2018 г., 20:48 Remi Forax <fo...@univ-mlv.fr>: > Testing the prototype, i've seen myself using -> null instead of a > classical empty method body when i want to have a method that does nothing. > > class A { > void f() -> null; > // versus > void f() { > } > } > > the compiler translates the concise version to aconst_null pop return > instead of a plain return. > > Obviously, in the real world, people doesn't write empty methods all the > time and i'm not sure if it's that important, anyway i think that question > should be raised, should we want to support this a pattern ? > > Rémi >