From `=> T` to `() => T` and back again

77 views Asked by At

As parameters of types => T and () => T are both Function0, I always naively assumed that conversion from one to another is a noop. It seems however, that while true for (=>T) => (() => T), the other direction (() => T) => (=> T) results in wrapping the execution of the function in a invokedynamic lambda - at least as far as I can read the byte code.

  1. Why?
  2. How can I make it stop?
0

There are 0 answers