scala3mock icon indicating copy to clipboard operation
scala3mock copied to clipboard

Support for by-name parameters

Open fmonniot opened this issue 1 year ago • 1 comments

By name parameters have a different compiler representation than regular functions and need to be handled explicitely in the when macro.

Example:

trait Test:
  def byNameParam(x: => Int): String

val t = mock[Test]
when(t.byNameParam).expect(1).returns("ok")

fmonniot avatar Aug 20 '23 21:08 fmonniot