Kiedy klamry są opcjonalne w składni lambda Java 8?

Zdaję sobie sprawę, że implementacja lambda Java 8 może ulec zmianie, ale w wersji lambda b39 odkryłem, że nawiasy klamrowe można pominąć tylko wtedy, gdy wyrażenie lambda zwraca typ inny niż void. Na przykład kompiluje:

public class Collections8 {
        public static void main(String[] args) {
                Iterable<String> names = Arrays.asList("Alice", "Bob", "Charlie");
                names.filter(e -> e.length() > 4).forEach(e -> { System.out.println(e); });
        }
}

Ale usunięcie takich szelek:

names.filter(e -> e.length() > 4).forEach(e -> System.out.println(e));

podaje błąd

Collections8.java:6: error: method forEach in interface Iterable<T> cannot be applied to given types;
        names.filter(e -> e.length() > 4).forEach(e -> System.out.println(e));
                                         ^
  required: Block<? super String>
  found: lambda
  reason: incompatible return type void in lambda expression
  where T is a type-variable:
    T extends Object declared in interface Iterable

Czy ktoś może wyjaśnić, co tu się dzieje?

questionAnswers(4)

yourAnswerToTheQuestion