dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

import kotlinx.coroutines.rx3.await mistakenly marked as unused

Open ZacSweers opened this issue 2 years ago • 2 comments
trafficstars

Build scan link

Plugin version

1.19.0

Gradle version

7.6

(Optional) Android Gradle Plugin (AGP) version

7.4.1

reason output for bugs relating to incorrect advice

Describe the bug

The following snippet in our codebase is incorrectly resulting in the org.jetbrains.kotlinx:kotlinx-coroutines-rx3 dependency getting marked as unused

import kotlinx.coroutines.rx3.await

// ...
class Presenter {
  fun example() {
    jobs +=
      viewModelScope.launch {
        runCatching {
            val usersMap = async { userRepository.get().getUsers(userIds).await() } // <-- used here
        }
      }
  }
}

I do see it identified in exploded-source.json under the Presenter class's imports. I also see it in the decompiled resulting class file

image

To Reproduce Steps to reproduce the behavior:

  1. Use the above import in code structured like the example

Expected behavior

It should not advice removing this dependency

Additional context

ZacSweers avatar Feb 09 '23 06:02 ZacSweers

I do not see it referenced in inline-usage.json, though I do see others 🤔

  {
    "coordinates": {
      "type": "module",
      "identifier": "org.jetbrains.kotlinx:kotlinx-coroutines-rx3",
      "resolvedVersion": "1.6.4"
    },
    "inlineMembers": [
      {
        "packageName": "kotlinx.coroutines.rx3",
        "inlineMembers": [
          "collect"
        ]
      },
      {
        "packageName": "kotlinx.coroutines.rx3",
        "inlineMembers": [
          "seenValue",
          "subscription",
          "value"
        ]
      }
    ]
  },

ZacSweers avatar Feb 10 '23 05:02 ZacSweers

Is this still an issue with 1.27.0?

autonomousapps avatar Dec 11 '23 08:12 autonomousapps

I'm going to close this for now. If it's still an issue, please re-open.

autonomousapps avatar May 01 '24 21:05 autonomousapps