mrmans0n / compose-rules

Lint rules for ktlint/detekt aimed to contribute to a healthier usage of Compose. Actively maintained and evolved fork of the Twitter Compose rules.
https://mrmans0n.github.io/compose-rules
Other
550 stars 21 forks source link

False negative for multiple-emiters-check #191

Closed WildOrangutan closed 7 months ago

WildOrangutan commented 7 months ago

compose:multiple-emitters-check failed to detekt issues, in following code.

 private fun Content(title: String? = null, subtitle: String? = null) {
     title?.let {
         Text(text = it)
     }

     subtitle?.let {
         Text(text = it)
     }
 }

I didn't double check this, since I'm short on time. I only noticed, that our CI didn't complain.

Library version: 0.3.3

mrmans0n commented 7 months ago

Yup good catch. These rules are supposed to be best effort, as we don't use type resolution and there is no way we could catch all mistakes.

However adding support for nullable/let statements in the detection code doesn't seem outlandish so I think I'll get this fixed as soon as I can.