Closed JakeWharton closed 1 year ago
(Also happy to contribute this and the others. Doing a big conversion and want to write everything down as I see it lest I forgot something that stands out)
The reason for it's omission was the ide experience really wasn't great in that it would really push you to omit passing anything into the generics which made it's common usage confusing. I do not feel that strongly about it though.
Seems okay? Any more details on what wasn't a good experience?
https://user-images.githubusercontent.com/66577/234742513-9722b639-2551-4900-9e09-0c58d8fbc876.mov
It's been a long while since I looked, it's possible they improved/fixed it. I remember it not giving you the braces before.
I'll move forward with the implementation and see if anything else comes about.
I'm really not one for code golf or anything, but I was surprised at its omission. My justification is that
isInstanceOf(KClass<T>)
provides the base functionality, and by the nature ofreified
requiringinline
aninline fun <reified T : Any> Assert<Any>.isInstanceOf(): Assert<T>
helper provides language feature support on top.It also potentially allows inference to be used so as to not require explicitly specifying the type at the function call at all?