https://kotlinlang.org logo
Title
r

raulraja

03/21/2019, 1:05 AM
but if you can avoid it I find working with type classes safer and more constrained
s

sam

03/21/2019, 9:06 PM
I think the problem is, people are not going to want to do TypeClass.apply { tests here } every time they use a matcher.
r

raulraja

03/21/2019, 9:30 PM
true, that's why we are proposing the Keep to have the syntax available implicitly. But in whatever case they don't have to if the Test or block surrounding the matchers has it in scope or is of that type
s

sam

03/21/2019, 10:09 PM
Yeah, but I don't know how it would be in scope other than by doing apply on a show instance. If in a test you are doing something like
val file = File(...)
file.isDirectory() shouldBe true
Then I'd like a Show<File> to be used rather than toString().
r

raulraja

03/21/2019, 10:59 PM
if your test class or surrounding scope implements
Show<File>
via
by
delegation it would but it's not as confortable as direct syntax, I get it