s1m0nw1
04/08/2019, 8:35 AMmkobit
04/08/2019, 1:22 PMinline class
• no init
means you cant can't constrain them on construction (like a PositiveInt
class where the constructor checks the provided value)
• mocking frameworks dont play nice them. if you have a function that takes fun myFun(positveInt: Int)
and you stub it using something like mockito, then switching it to fun myFun(positveInt: PositiveInt)
, it is tough to wrangle mockito matchers and verifiers to do what you want them to dos1m0nw1
04/08/2019, 1:24 PMmkobit
04/08/2019, 2:14 PMs1m0nw1
04/08/2019, 2:40 PMGeert
04/11/2019, 10:15 AM