Marko Novakovic
12/07/2022, 9:05 PMStylianos Gakis
12/07/2022, 9:40 PMMarko Novakovic
12/07/2022, 11:10 PMIf you don’t do that you’ll get the inferred type of just String for both username and for password, effectively meaning that you can pass either of them to the same function which would expect only one of them.if you have tests that’s probably not going to happen but ok what am talking about is that FP Kotlin community is relying on types way to much compared to what you see in other, also type safe, languages
Marko Novakovic
12/07/2022, 11:11 PMUnit
return type of functions and they showed you how to disable IDE telling you that specifying Unit
return type is not neededStylianos Gakis
12/07/2022, 11:20 PMfun foo() = ...
, then I’d also want the Unit
to be there, otherwise we’re back at trying to figure out if something actually returns here and what its type is.
Where’s that part of the arrow docs btw?Marko Novakovic
12/07/2022, 11:33 PMWhy write a test for what a type can achieve? The tests may miss something, your type won’t be accepted in a function which expects a different type.
Keeping the public API of a class fully typed out comes with a few benefits, like not rogue changing your public if you change the implementation and accidentally return something elseall of this can be mitigated/solved with having comprehensive test suite. and no, am not talking writing type specific tests
Marko Novakovic
12/07/2022, 11:35 PMEmil Kantis
12/08/2022, 4:24 AMEmil Kantis
12/08/2022, 4:28 AMJannis
12/08/2022, 9:14 AMJannis
12/08/2022, 9:21 AM