Lambda Concise method and void return type

Remi Forax forax at
Sun Sep 30 13:48:13 UTC 2018

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 ?


More information about the amber-spec-experts mailing list