0

I saw from this question and my own testing that (x: => Int) does not actually expect a function, but rather, it just takes an integer. But then isn't that the same as just using (x: Int)?

  • It's lazily evaluated because it's a function. Anytime the value of x is attempted to be fetched, then it will actually call a function to get this data. – Aliics Jun 29 '21 at 01:23

0 Answers0