bnorm
04/30/2026, 4:09 PMbnorm
04/30/2026, 4:14 PMrobstoll
05/04/2026, 8:19 AM@PowerAssert be part of the stdlib in 2.4.0-RC or do I still need an extra dependency?
Theproperty will returnexplanationin cases when anullannotated function is called without call-site information, including:@PowerAssert
• The call-site was compiled without the compiler plugin applied.
• When called from non-Kotlin code. For example, Java.
• When called via reflection or method reference.Could you please use something like
Result<CallExplanation>? for explanation . I would like be able to distinguish between: the user has not applied the compiler plugin (in which case I can give a hint to the user) vs. the information is not available because of Java/reflection
Regarding method reference, say I have foo with @PowerAssert which takes T
foo(::bla)
will explanation now not even contain ::bla?bnorm
05/04/2026, 11:59 AMDid I understand it correctly, willNo, it will still be an extra dependency. But this dependency will be provided automatically by the Power-Assert Gradle plugin, so for most users, no additional configuration should be required. Libraries may need to adjust what source sets are targeted by the Gradle plugin so main compilations are included, but then the dependency will be added to those compilations as well.be part of the stdlib in 2.4.0-RC or do I still need an extra dependency?@PowerAssert
Could you please use something likeUnfortunately, it is not possible to distinguish between these cases. Because it's a compiler plugin, it's either applied or its not. There's no way to know the call was made from a context where the compiler plugin could have been applied. In the future - as we move power-assert into the language proper - we will be able to warn about this. But that is still a long ways off.forResult<CallExplanation>?. I would like be able to distinguish between: the user has not applied the compiler plugin (in which case I can give a hint to the user) vs. the information is not available because of Java/reflectionexplanation
[...] will explanation now not even containIf it doesn't, this would be considered a bug.?::bla